Timer interrupt crashes processor?

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
jan.didden
Posts: 82
http://meble-kuchenne.info.pl
Joined: Thu Dec 17, 2020 3:16 pm
Has thanked: 20 times
Been thanked: 12 times

Timer interrupt crashes processor?

Post 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
Attachments
NEC Own Timer PIC lean isr.fcfx
(16.6 KiB) Downloaded 51 times

Steve-Matrix
Matrix Staff
Posts: 1234
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 167 times
Been thanked: 277 times

Re: Timer interrupt crashes processor?

Post by Steve-Matrix »

Sounds like a strange problem. Could it be a watchdog timer issue?

medelec35
Matrix Staff
Posts: 1431
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 505 times
Been thanked: 468 times

Re: Timer interrupt crashes processor?

Post by medelec35 »

Hi Jan.
Please see this post.
Martin

Post Reply