Page 1 of 1
PIC freezes
Posted: Fri Jun 15, 2018 9:14 pm
by electron67
Hello everyone, someone can help me, I think can use the MCLR to reset the PIC using C language, I do not know how to apply that language
I'm working with the PIC16F1509 sometimes the PIC freezes (one time at month), I think that can activate a timer1 so that every 5 or 10 minutes a reset is sent through software and I can reset the Pic and prevent it from freezing; so as not to use a push button on the MCLR, because the circuit would not be in place accecible.
Thank you very much, I hope someone can help me
Enrique
Re: PIC freezes
Posted: Mon Jun 18, 2018 3:05 pm
by Benj
Hello Enrique,
This C command should do what you need it to.
The Watchdog timer may also be an option for you to perform an auto reset if things lock up.
However it might be worth trying to get to the bottom of why the chip is locking up.
Is it getting stuck somewhere in the software.
Maybe a stack related issue? MacroA calls MacroB which calls MacroA etc, eventually this will overflow and cause RAM corruption.
Maybe an interrupt function conflict with some standard function, i.e. a potential collision waiting to happen.
Do you get any meaningful warning messages in the compiler output window?
Or maybe it's a hardware issue and the VCC is slowly browning out or unable to provide enough current under certain high load situations.
Re: PIC freezes
Posted: Mon Jun 18, 2018 4:18 pm
by electron67
Hi Benj
Thank you very much for helping me, I'm going to review the suggestions you recommend to try to avoid this failure, because it is complicated and expensive to be periodically checking the circuit, the watchdog had understood that it did not work with the flowchart,
if I can use watchdog with Flow7
I will also check the voltage source, it could have variations. . .
Re: PIC freezes
Posted: Tue Jun 26, 2018 6:06 am
by electron67
Hi Benj
I have something wrong in the flowchart or I'm missing some data, I've seen examples in the forum and included the RESET (); but I can not restart the program. . .