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

CCS Bootloader and WatchDog

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



Joined: 18 Oct 2003
Posts: 145

View user's profile Send private message

CCS Bootloader and WatchDog
PostPosted: Sun Jun 18, 2006 12:34 pm     Reply with quote

Hi,

I need to have WatchDog in my program and for this I activate this fuse in the CCS bootloader and my program, this is the fuse

Code:
#include <18F4620.h>
#device *=16
#fuses   H4, WDT4096, PROTECT, NOLVP, PUT
#use delay(clock=40000000, RESTART_WDT)
#use rs232(baud=115200, xmit=PIN_C6, rcv=PIN_C7, RESTART_WDT)
#opt 10


and in the main put:

Code:
setup_wdt( WDT_ON );


But the watchdog not work, anybody know where is the problem????

Thank you very much!!

Best Regards,
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

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

PostPosted: Sun Jun 18, 2006 6:14 pm     Reply with quote

You have reset WDT enabled in #use delay. This means whenever time functions get used (such as delay_ms) or whenever you send a character the WDT is reset. If you program "crashes" in such a manner that it reamins in a loop that uses any delay functions the WDT will never time out.

Because you have used such a large WDT valaue (4096) the easiest solution is to remove the reset wdt from the #use delay statement.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
cfernandez



Joined: 18 Oct 2003
Posts: 145

View user's profile Send private message

PostPosted: Mon Jun 19, 2006 9:07 am     Reply with quote

asmallri,

Thank you very much!, for your answer. I delete RESTART_WDT and now work!.

Best Regards,
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