Timer interrupt crashes processor?
Posted: Mon May 23, 2022 6:25 pm
I am working on a project that uses an interrupt-on-change from a pin, as well as a timer interrupt.
The IOC comes from an infra red remote transmitter. As long as the timer interrupt is disabled, it works as designed; when the remote is activated, the interrupt service routine is called and after servicing things return to a main loop.
But when the timer interrupt is enabled, and a remote control transmission interrupt is generated, the program seems to crash and restarts.
And it remains in that state: crash, restart, turn off LED, generate an IOC (without any IR signal!), turn on LED, crash, restart, turn off LED, ad infinitum.
The attached test routine turns on a LED in the IOC service routine (called FallingEdge) macro, and, with the timer int enabled, crashes and restarts (LED is turned off), then after the 1s delay, another IOC interrupt appears to be generated with no input at all!
I am at a loss. Anyone seen this before? FC9, PIC16F15355.
Jan Didden
The IOC comes from an infra red remote transmitter. As long as the timer interrupt is disabled, it works as designed; when the remote is activated, the interrupt service routine is called and after servicing things return to a main loop.
But when the timer interrupt is enabled, and a remote control transmission interrupt is generated, the program seems to crash and restarts.
And it remains in that state: crash, restart, turn off LED, generate an IOC (without any IR signal!), turn on LED, crash, restart, turn off LED, ad infinitum.
The attached test routine turns on a LED in the IOC service routine (called FallingEdge) macro, and, with the timer int enabled, crashes and restarts (LED is turned off), then after the 1s delay, another IOC interrupt appears to be generated with no input at all!
I am at a loss. Anyone seen this before? FC9, PIC16F15355.
Jan Didden