CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

reseting the PIC when the program counter is corrupted

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
JIm
Guest







reseting the PIC when the program counter is corrupted
PostPosted: Tue May 29, 2007 5:24 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue May 29, 2007 5:41 pm     Reply with quote

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).
Code:
#fill_rom 0x00FF
Guest








PostPosted: Tue May 29, 2007 8:14 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Sep 21, 2007 7:40 am     Reply with quote

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

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Sep 21, 2007 7:46 am     Reply with quote

Code:
reset_cpu()
Smile
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Fri Sep 21, 2007 7:47 am     Reply with quote

..

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

View user's profile Send private message

PostPosted: Fri Sep 21, 2007 7:47 am     Reply with quote

wow that was a quick one Smile

thanks Laughing
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group