Timer2 Interrupt, 16F1823
I'm using a Timer2 interrupt on the timer's value match to PR2. I would like to enable/disable the interrupt function during the course of my program. Is it better to enable/disable using global interrupt enable GIE (INTCON bit 7) or timer 2 interrupt enable TMR2IE (PIE1 bit1)?
Re: Timer2 Interrupt, 16F1823
If you also have other interrupt sources then clearing the GIE-bit will of course disable them too. Clearing TMR2IE will disable that interrupt only. If you're using DT-INTS then you can use @ INT_DISABLE TMR2_INT.
/Henrik.
Re: Timer2 Interrupt, 16F1823
Henrick,
Clearing TMR2IE is working .. just tried it. I only have one interrupt source so clearing GIE would probably also work. I'm not using DT_INT, not needed with the 16F1823 family.
Re: Timer2 Interrupt, 16F1823
Great!
So you're writing the interrupt service routine all in ASM then? Well that's is indeed the best way but also the hardest - at least for me, because I suck at it :-(
/Henrik.
Re: Timer2 Interrupt, 16F1823
How to setup Timer2 interrupt????????
Re: Timer2 Interrupt, 16F1823