View previous topic :: View next topic |
Author |
Message |
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
Runtime Control of WDT on 10F202 |
Posted: Wed Aug 02, 2006 9:40 am |
|
|
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
|
|
Posted: Wed Aug 02, 2006 8:34 pm |
|
|
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
|
|
Posted: Wed Aug 02, 2006 9:11 pm |
|
|
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
|
|
Posted: Thu Aug 03, 2006 10:25 am |
|
|
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* |
|
|
|