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

Runtime Control of WDT on 10F202

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



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

Runtime Control of WDT on 10F202
PostPosted: Wed Aug 02, 2006 9:40 am     Reply with quote

Hello All,

I've searched and found a previous question that I posted that was similar regarding the WDT and delays on an 18F part. Andrew actually answered the question but didn't say how to accomplish it so I'll ask more specifically.

I'm using the WDT on the 10F part as a timer to reduce duty cycle in certain circumstances, i.e. sometimes I'd like the WDT to wake the part and others not... a la turn it on and off.

I'm hoping that setting or clearing the WDTE bit will do that.... and if it will can some one help with the code to do that?

Currently I'm not using the WDT fuse and enabling the WDT with:
Code:
setup_wdt(WDT_2304MS);



Thanks,

John
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Aug 02, 2006 8:34 pm     Reply with quote

I can't see anything in the 10F202 data sheet that says the WDT can
be enabled/disabled at runtime. Some 18F PICs can do this with a
bit in the WDTCON register, but the 10F202 doesn't have that feature.
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Wed Aug 02, 2006 9:11 pm     Reply with quote

Thanks,

That is kind of what I had figured. But I was hoping otherwise. I think I'll have to go to a 12F683 part to do what I want. I need to be able to a few things not possible w/ the 10F parts. (note to self: read and understand datasheets prior to spending money....)

John
Guest








PostPosted: Thu Aug 03, 2006 10:25 am     Reply with quote

Since you cannot start/stop the WDT at runtime, how about faking it? Create a ISR that resets the WDT, causing a "stop" (eg., the WDT never resets the uP), and then also does not reset the WDT causing a reset...

make sense?

#1. Create a timer0/1/2 etc. (or hook into exisiting)
#2. If a flag = TRUE, issue a restart_wdt(), causing the WDT to NOT reboot
#3. If a flag = FALSE, let the WDT trickle down etc., causing the WDT to reboot at some point...

Take care,

~Kam (^8*
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