Hello all, I have seen an old post a while ago discussing an interesting problem but I just don't seem to be able to find it: Somebody described an interesting experiment that demonstrated that setting IEN to 0 does not shut down interrupt immediately but after a couple of clock cycles. If I remember correctly, he suggested solving the problem like this:
_atomic(0) ; IEN = 0 ;
Is there indeed a reason to be worried given the prefetch pipeline?
Thanks in advance, Tamir Michael
Yes, interrupts are not globally disabled until one instruction after clearing the IEN bit. If this is a problem, you can use:
_atomic_(0); IEN = 0; _nop_(); _endatomic_();
C166 is not the only microprocessor requiring special consideration when enabling/disabling interrupts, see for example: www.atmel.com/.../DOC1156.PDF
Sauli
YIKES... are there any similar issues with the NXP LPC parts...?
Sure. Same core, same behaviour.