Page 1 of 1

Timer interrupt crashes processor?

Posted: Mon May 23, 2022 6:25 pm
by jan.didden
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

Re: Timer interrupt crashes processor?

Posted: Tue May 24, 2022 9:08 am
by Steve-Matrix
Sounds like a strange problem. Could it be a watchdog timer issue?

Re: Timer interrupt crashes processor?

Posted: Wed May 25, 2022 10:50 am
by medelec35
Hi Jan.
Please see this post.