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

WDT_2304MS ??!!

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



Joined: 30 Nov 2005
Posts: 8

View user's profile Send private message

WDT_2304MS ??!!
PostPosted: Sat Dec 17, 2005 5:52 am     Reply with quote

I have this on a PIC16 code and i need to shift to a PIC18f code .. what is the translation of this on a standard header file for the 18F ???
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Sat Dec 17, 2005 8:45 am     Reply with quote

Generally you have to look in the data sheet to confirm this on any particular 18F processor (you didn't say which one you are using) but on the 18F6720 for example it has a separate free running WDT oscillator with an 18ms timeout. So, to get 2304, you have to set the WDT128 fuse for the 128 divider.

The WDT setup line is not required.
Zaki



Joined: 30 Nov 2005
Posts: 8

View user's profile Send private message

PostPosted: Sun Dec 18, 2005 6:48 am     Reply with quote

Actually I am using a PIC 18F252 and i have really little information regarding the PIC ..I mean code wise how would i replace that command
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Dec 18, 2005 8:28 am     Reply with quote

Quote:

Actually I am using a PIC 18F252 and i have really little information regarding the PIC ..I mean code wise how would i replace that command


The WDT in the 18F is setup at programming time. Add WDT128 to your fuses similar to the example below.

#fuses WDT128, PUT, BROWNOUT......

Then change the line setup_wdt(WDT_2308MS) to setup_wdt(WDT_ON)

This is all in the manual on page 198 under setup_wdt() and in the 18F252 header file.

Also, if you get the data sheet from www.microchip.com you will have virtually everything this is to know about the 18F252 hardware.
aopg64



Joined: 17 Oct 2005
Posts: 28
Location: Hampshire, UK

View user's profile Send private message

PostPosted: Tue Jan 10, 2006 10:06 am     Reply with quote

Hi folks,

I too am porting some 16F code to 18F code. A while back we had problems with the silicon of the 16F876A WDT so we change our normal 2.3s WDT to 18ms via a serial command in a test mode and check that the PIC does indeed watchdog in 18ms.

I would like to port this feature, but as the 18F WDT is set in a programming fuse, I can't change it dynamically in the code.

I _know_ I probably don't need this feature anymore with the 18F, but if it is possible, it would be nice to be able to dynamically change the WDT to keep test procedures similar to the old ones.

Anyone know if it _can_ be done? It would be useful anyway as sometimes some code lock-ups are more time critical than others!

TIA,

Nigel
_________________
No comment! (Can't think of anything interesting to say!)
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