Interrupt
Posted: Mon Apr 29, 2013 10:46 am
When an interrupt like TMR0 is turned off and on again using some C code to do it I would expect that on turning it on the interrupt would count to 255 and fire the macro after that. But I find that it fires the macro immediately it is turned on. Is there a way around that?
If I used the Flowcode command to turn it off and on again would it be different? I forget now but think I was using C to be faster.
//Turn on interrupts
//C Code:
intcon.T0IE = 1; // Turn timer on
intcon.PEIE = 1; // Enable peripheral interrupts
intcon.GIE = 1; // Enable global interrupts
If I used the Flowcode command to turn it off and on again would it be different? I forget now but think I was using C to be faster.
//Turn on interrupts
//C Code:
intcon.T0IE = 1; // Turn timer on
intcon.PEIE = 1; // Enable peripheral interrupts
intcon.GIE = 1; // Enable global interrupts