1 Microsecond pulses

RIDDICK:

johnwasser:

PIND = 0x10;  // Toggle Pin 4 (Port D bit 4)

PIND = 0x10;  // Toggle Pin 4  back (Port D bit 4)

2 clocks faster should b this pulse: :slight_smile:
PORTD = 1<<4;
PORTD = 0;

Problem is that will also set all the OTHER pins in PORTD to 0/LOW. To avoid that you would normally use this code:

PORTD |= 0x10; // Switch on pin 4
PORTD &= 0xEF; // Switch off pin4

but they require two read-modify-write cycles which I expect will make them slower than the PIN register.