|
|
View previous topic :: View next topic |
Author |
Message |
cfernandez
Joined: 18 Oct 2003 Posts: 145
|
CCS Bootloader and WatchDog |
Posted: Sun Jun 18, 2006 12:34 pm |
|
|
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
|
|
Posted: Sun Jun 18, 2006 6:14 pm |
|
|
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
|
|
Posted: Mon Jun 19, 2006 9:07 am |
|
|
asmallri,
Thank you very much!, for your answer. I delete RESTART_WDT and now work!.
Best Regards, |
|
|
|
|
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
|