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 support@ccsinfo.com

Fuse problem with WDT

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







Fuse problem with WDT
PostPosted: Mon Feb 24, 2003 11:53 am     Reply with quote

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

View user's profile Send private message

Re: Fuse problem with WDT
PostPosted: Mon Feb 24, 2003 12:07 pm     Reply with quote

:=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
PostPosted: Mon Feb 24, 2003 12:29 pm     Reply with quote

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
PostPosted: Mon Feb 24, 2003 12:29 pm     Reply with quote

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
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