>Another head-scratcher... > >In short, on a PIC16F874A, with TMR0IE cleared, >Timer-0 interrupts are still being generated. I bet they are not being generated (see below). >As a test, in the ISR code after checking that TMR0 >flag was set, I added a few lines of code to verify >that TMR0IE is really set, before performing the >appropriate Timer-0 code for my app. This makes the >code work properly, but it's a very odd workaround. I bet what happens when you turn TMR0IE off is an interrupt is generated by something else, whose flag you check AFTER the TMR0IF flag, and so the interrupt routine acts as though it has had a TMR0 interrupt. The fix you have is the normal way of making sure that a turned off interrupt does not fire off the interrupt routine. Thou shalt write 1000 lines "When I turn an interrupt off using the IE flag, my interrupt routine shall check the IE flag before the IF flag." -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist