View previous topic :: View next topic |
Author |
Message |
JIm Guest
|
reseting the PIC when the program counter is corrupted |
Posted: Tue May 29, 2007 5:24 pm |
|
|
hi,
Does anyone know if there is any FUSE that can be used to reset the PIC18F720 when the program counter is corrupted?
if not, there is any approache one can take to help the system recovery in the event of the PC corrupted?
Also, when code is already flashed in the PIC and PIC works normally, but is there any possibility that the code can be corrupted and the PIC won't work again? if this can be true, then can we use the FUSE WRT to protect this?
Jim |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue May 29, 2007 5:41 pm |
|
|
Quote: |
Does anyone know if there is any FUSE that can be used to reset the
PIC18F720 when the program counter is corrupted?
If not, there is any approach one can take to help the system recovery
in the event of the PC corrupted? |
A couple techniques that I can think of would be to:
1. Use the Watchdog timer.
2. Use the #fill_rom directive to fill unused ROM with the opcode
for the Reset instruction (only works with 18F PICs).
|
|
|
Guest
|
|
Posted: Tue May 29, 2007 8:14 pm |
|
|
PCM programmer,
thank you so much for your suggestion. Can anyone explain me what the FUSE WRT can do? I kind of get the idea, but for my knowlegde, I just to want confirm it with the expert.
Thank |
|
|
ELCouz
Joined: 18 Jul 2007 Posts: 427 Location: Montreal,Quebec
|
|
Posted: Fri Sep 21, 2007 7:40 am |
|
|
being on the topic ,,,
how to manually reset the pic
#fill_rom 0x00FF
doesn't work because it must be declared at the program startup
lets say that i want to reset the pic via RS232 ... is there a code that will reset the pic or instruction so i can catch it from rs232?
if (blabla == '0')
{
printf(usb_cdc_putc,"\r\nPIC-USB Reset...");
#fill_rom 0x00FF dont work anyway (#
}
thank you ! |
|
|
SET
Joined: 15 Nov 2005 Posts: 161 Location: Glasgow, UK
|
|
Posted: Fri Sep 21, 2007 7:46 am |
|
|
|
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Fri Sep 21, 2007 7:47 am |
|
|
..
Last edited by treitmey on Fri Sep 21, 2007 7:48 am; edited 1 time in total |
|
|
ELCouz
Joined: 18 Jul 2007 Posts: 427 Location: Montreal,Quebec
|
|
Posted: Fri Sep 21, 2007 7:47 am |
|
|
wow that was a quick one
thanks |
|
|
|