Hi, On Sat, Sep 12, 2009 at 4:33 AM, cdb wrote: > Why not, XOR the port bit in the ISR routine and not only save some > typing, but also have the function in one place., or set a flag in the > ISR and then XOR the port bit in your main code? That's possible, the use of a state flag in the ISR, rather than the actual PORT I/O operation. I will try that way. What i was trying to implement with that code snippet was a counter based on RB0/INT edges. The busy (indefinite) loop represented the actual task that i have to do, while the ISR represents the counter. What i am really wondering, is that why it doesn't move out of the ISR in my original example (ie the LED is always lit. If it moved out of the ISR, in the indefinite loop, the LED would've been switched off. So, i am wondering why it is always in the ISR, being curious about what really happened in there) -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist