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
PIC freezes
Moderator: Benj
-
- Posts: 311
- Joined: Sat Jan 12, 2008 2:08 am
- Has thanked: 104 times
- Been thanked: 47 times
- Contact:
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PIC freezes
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.
This C command should do what you need it to.
Code: Select all
RESET();
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 311
- Joined: Sat Jan 12, 2008 2:08 am
- Has thanked: 104 times
- Been thanked: 47 times
- Contact:
Re: PIC freezes
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. . .
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. . .
-
- Posts: 311
- Joined: Sat Jan 12, 2008 2:08 am
- Has thanked: 104 times
- Been thanked: 47 times
- Contact:
Re: PIC freezes
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. . .
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. . .
- Attachments
-
- RESET.fcfx
- Test flowchart
- (7.84 KiB) Downloaded 210 times