Hello all.
Let's look at this code
int main() { //something for(;;) { sei(); asm("nop"); cli(); //something } ...
Timer2 (8-bit) works in CTC mode and generates an interrupt every 10ms. I don't wont to be interrupted anywhere else in my code, except on the begining of the loop.
Datasheet says :
"When using the SEI instruction to enable interrupts, the instruction following SEI will be exectuted before any pending interrupts.."
So, my coude should execute SEI, then NOP and then CPU should execute any pending interrupts before executing CLI instruction? But that doesn't happen. No interrupts happen. If I put 5-6x nop-s same thing.
Why? What's wrong? How much "time" has to pass before CPU executes pending (int. flag set) interrupts after the SEI instruction?
Thank you very much !