I was working on external interrupt. The code below works fine and LED toggles at the rate of 3000 msec ON time and 500 msec OFF time. But if
is placed after sei(), I see 3000msec offtime and 500msec on time. How this sequence affect the toggle operation even after adding 10msec delay before entering while loop? I can see that LED flashes once before entering while loop in this case. That means does configuring EICRA register causes any interrupt?
PORTD^=(1<<PD3); // Toggle the port pin
PORTD &= ~((1<<PD3)|(1<<PD4));
PORTD|=1<<PD2; // Enables pull up
// Behavior changes if EICRA initialization is moved to here
//_delay_us(1); // Added delay. Had some issues on few occasion.
Note: For some reason, add code <> is not working today for me. Nothing happens when <> is clicked. So could not place the code inside <>. Sorry for the inconvenience.