|
|
View previous topic :: View next topic |
Author |
Message |
stevev Guest
|
Fuse problem with WDT |
Posted: Mon Feb 24, 2003 11:53 am |
|
|
I'm trying to add a WDT to my (almost finished) code, running on a 16F877. I'm using PCM 3.145 and IDE 3.26.
The code works great with the following fuse:
#include <16F877.h>
#fuses HS, NOWDT, NOPROTECT
However. as soon as I change it to:
#fuses HS, WDT, NOPROTECT
The MPU freezes (remains in reset?). This happens whether or not I initialize the WDT timer values with SETUP_WDT().
Any ideas on what I'm doing wrong? It seems like it should be simple but this has me stumped.
Thanks, steve
___________________________
This message was ported from CCS's old forum
Original Post ID: 12059 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
Re: Fuse problem with WDT |
Posted: Mon Feb 24, 2003 12:07 pm |
|
|
:=I'm trying to add a WDT to my (almost finished) code, running on a 16F877. I'm using PCM 3.145 and IDE 3.26.
:=
:=The code works great with the following fuse:
:=#include <16F877.h>
:=#fuses HS, NOWDT, NOPROTECT
:=
:=However. as soon as I change it to:
:=#fuses HS, WDT, NOPROTECT
:=
:=The MPU freezes (remains in reset?). This happens whether or not I initialize the WDT timer values with SETUP_WDT().
:=
:=Any ideas on what I'm doing wrong? It seems like it should be simple but this has me stumped.
-----------------------------------------------------------
Do you ever restart the watchdog timer, within your code ?
You need to do that by inserting the following function
in your main loop. Also, set the watchdog period so
that it's long enough that it doesn't time out between
calls to the restart function.
restart_wdt();
See the CCS example file, EX_WDT.C. It's in this folder:
c:\Program Files\Picc\Examples
___________________________
This message was ported from CCS's old forum
Original Post ID: 12060 |
|
|
stevev Guest
|
Re: Fuse problem with WDT |
Posted: Mon Feb 24, 2003 12:29 pm |
|
|
Thanks, I thought I was resetting it properly but when I put the SETUP_WDT(WDT_576MS); restart_wdt(); line to the start of my main program it works.
I appreciate so much the quick reply. It really is easy!
-steve-
:=:=
:=:=The code works great with the following fuse:
:=:=#include <16F877.h>
:=:=#fuses HS, NOWDT, NOPROTECT
:=:=
:=:=However. as soon as I change it to:
:=:=#fuses HS, WDT, NOPROTECT
:=:=
:=:=The MPU freezes (remains in reset?). This happens whether or not I initialize the WDT timer values with SETUP_WDT().
:=:=
:=:=Any ideas on what I'm doing wrong? It seems like it should be simple but this has me stumped.
:=-----------------------------------------------------------
:=
:=Do you ever restart the watchdog timer, within your code ?
:=You need to do that by inserting the following function
:=in your main loop. Also, set the watchdog period so
:=that it's long enough that it doesn't time out between
:=calls to the restart function.
:=
:=restart_wdt();
:=
:=See the CCS example file, EX_WDT.C. It's in this folder:
:=c:\Program Files\Picc\Examples
___________________________
This message was ported from CCS's old forum
Original Post ID: 12061 |
|
|
stevev Guest
|
Re: Fuse problem with WDT |
Posted: Mon Feb 24, 2003 12:29 pm |
|
|
Thanks, I thought I was resetting it properly but when I put the SETUP_WDT(WDT_576MS); restart_wdt(); line to the start of my main program it works.
I appreciate so much the quick reply. It really is easy!
-steve-
:=:=
:=:=The code works great with the following fuse:
:=:=#include <16F877.h>
:=:=#fuses HS, NOWDT, NOPROTECT
:=:=
:=:=However. as soon as I change it to:
:=:=#fuses HS, WDT, NOPROTECT
:=:=
:=:=The MPU freezes (remains in reset?). This happens whether or not I initialize the WDT timer values with SETUP_WDT().
:=:=
:=:=Any ideas on what I'm doing wrong? It seems like it should be simple but this has me stumped.
:=-----------------------------------------------------------
:=
:=Do you ever restart the watchdog timer, within your code ?
:=You need to do that by inserting the following function
:=in your main loop. Also, set the watchdog period so
:=that it's long enough that it doesn't time out between
:=calls to the restart function.
:=
:=restart_wdt();
:=
:=See the CCS example file, EX_WDT.C. It's in this folder:
:=c:\Program Files\Picc\Examples
___________________________
This message was ported from CCS's old forum
Original Post ID: 12062 |
|
|
|
|
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
|