|
|
View previous topic :: View next topic |
Author |
Message |
dietmar Guest
|
sleep and WDT on 18f6585 |
Posted: Wed Sep 07, 2005 4:23 am |
|
|
Hi, ia am using a 18f6585 device with RTOS on it.
I want to put it into low power mode and there are 3 ways i thought about...
1:Setting up WDT at startup but disablingit during sleep like that:
SETUP_WDT(OFF);
sleep();
SETUP_WDT(ON);
The pic would the be woken up by CAN bus or RS232.BUT:
Is this a safe way, is it possible that the pic hangs up itself during sleep when it is asleep for 24 hours?I dont want it to sleep forever, what i am building is a security controller...I need it safe!
2:Using Timer 1 or 3 with watchdog enabled.As i read in datasheet, these timers have a built in oscillator which is even active on sleep mode.Right???Well, is it possible to reset WDT with these timers and then immediatelly go into sleep again?An is this a good sleep mode, wakeing up every 80ms????
3:Setting up WDT, then sleep and reset the pic by watchdog. Then looking to reset cause , reading out the internal_eeprom for getting the current mode the controller is in and switch back to that mode.... But is it possible to read out the eeprom every two seconds and that over years? Wouldnt it be damaged???
Well are there any other ideas or what is the best and safest way to go into low power mode? any suggestions? Thanks for ur help.... |
|
|
Ttelmah Guest
|
|
Posted: Wed Sep 07, 2005 5:09 am |
|
|
Just use the WDT, and set it to give a reset at suitable intervals.
You don't need to read the EEPROM. You memory registers are maintained during sleep, and will still hold the contents they held when the chip went to sleep. For real security, add an external timer, with a long interval (a minute or more), and reset this whenever the chip wakes. If something goes _really_ screwy, and the chip does not wake, this can be used to force a full reset.
Best Wishes |
|
|
|
|
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
|