Archives
-
Watchdog Timer and Sleep Modes
Reading over the watchdog timer section of the UM for the LPC17xx family it states – “Once the WDEN and/or WDRESET bits are set they can not be cleared by software. Both flags are cleared by an external reset or a Watchdog timer underflow. [page 568 - CH28 section 4.1]“. Since instructions are not executed during Sleep – how do you feed / kick / service the watchdog? I thought that by using the PCLK this would be an issue since the PCLK should not be running during Sleep, consequently not decrementing the counter but this is not the case. “Watchdog reset or interrupt will occur any time the watchdog is running and has an operating clock source. Any clock source works in Sleep mode, and the IRC works in Deep Sleep mode. If a watchdog interrupt occurs in Sleep or Deep Sleep mode, it will wake up the device. [page 585 CH28 section 4.1]“.
My question is how do you sleep and not reset due to a watchdog timer timeout? Will the ISR continuously fire during sleep? Does this mean that the PLL0 will connect and reconnect every WDT timeout?Any and all help is appreciated, Thanks!
Related Forum Messages
- WDT and Sleep Modes
- Using the watchdog to wake up from sleep
- Watchdog and sleep mode.
- Write our own Watchdog function..?
- LPC11xx low power modes
- Watchdog timer problem of dspic30f4011
- PIC18F26K22 and sleep mode
- Does wake up from sleep clear WDT?
- Using Watchdog Timer for long delays
- Question on watchdog timer sleep
- PIC24F Deep Sleep Watchdog Timer Periods are longer than the SPEC
- Watchdog, sleep & overflow @ pic16f628a
- Stellaris Watchdog
- Configuration Registers
- Watchdog timer Postscaler Query
- Sleep() and watchdog timer
- Self Testing WatchDog
- Sleep mode, WDT and PC innterupt not operating properly
- Timings, Loops – More.
- Wake PIC18 (with internal clock) from deep sleep at a certain time
Reading over the watchdog timer section of the UM for the LPC17xx family it states - "Once the WDEN and/or WDRESET bits are set they can not be cleared by software. Both flags are cleared by an external reset or a Watchdog timer underflow. [page 568 - CH28 section 4.1]". Since instructions are not executed during Sleep - how do you feed / kick / service the watchdog? I thought that by using the PCLK this would be an issue since the PCLK should not be running during Sleep, consequently not decrementing the counter but this is not ...Hey, I'm trying to make a timer thingie that basically just displays the elapsed time on an LCD. I want to put the CPU to sleep every second (or every 500ms) and just wake up from sleep to refresh the LCD with the current time (need to have timer0 running so I can't do a full power-down, just power-save afaik). The documentation on the watchdog and sleep seem surprisingly sparce and I'm having trouble setting it up. Currently I'm doing something like this (just showing the bits related to sleep and watchdog): Code: #include ltavr/wdt.hgt #include ltavr/sleep.hgt #include ltavr/interrupt.hgt void setup() { ...Hi, What will happen if i put the AVR to sleep mode (power down) and i have a watchdog running? Will the watchdog go also to sleep or do i have to wake up my CPU every e.g. 5sec to reset the WDT counter before it starts a reset? Thanks,Hi, if my understanding of Watchdog is correct, in normal operation mode, if WDT is not clear, it will reset the PIC. In sleep mode, if WDT is not cleared, it will wake up the PIC from sleep. If that is the case, then if we use WDT to reset the PIC if it hang, we can't cause the PIC to sleep for a very long time (hours) because the WDT will time out very fast which will wakeup the PIC. Just wondering, lets say I want the PIC to reset itself (if it hangs) but only wake up the PIC by ...After studying the datasheets and UM for the LPC11xx series micros, I have some questions about the lower power modes (not limited to Sleep and Deep Sleep). I have an application where reasonally accurate timing (+/- 5% max) must be kept (with one timer running) with power being as low as possible (sub 10uA with lower being better). Here's the problem. In Deep Sleep Mode, the only oscillator available to run a timer is the watchdog oscillator. However, this oscillator has a tolerance of about +/- 40%. Not only that, there appears to be no way to calibrate it. That is, I ...hi , I'm working with dspic30f4011 and sim548c for my project. I am charging a 3.7v battery by sim548c's charger circuit.To charge the battery I have to keep mcu to sleep mode.I wake my mcu up by watchdog timer .but when my mcu goes to sleep mode ,it restarts.Basically Micro controller restarts most of the time when I try to keep it in sleep mode.Data sheet says that when watchdog timers period is over then the mcu will get up from sleep if it was entered in sleep before activating watchdog.But my mcu is here getting reset .please some on help ...I'm using the PCWHD V4.132 compiler. I have an application I would like to run on a PIC18F26K22 platform that normally uses the internal oscillator at 4MHz and also uses the sleep mode. I want the watchdog timer and an external interrupt to be able to wake the platform from sleep. I planned the watchdog to wake at the longest period (WDT32768 postscaler for a wakeup period of about 2.18 minutes) with the external interrupt (EXT0) waking immediately. I got the baseline program working with the internal oscillator at 4MHz successfully. I used the #FUSES INTRC_IO for the internal oscillator. ...Hi all, Fact: Suppose the device gets into sleep mode by actually and properly executing sleep instruction (assembly) -- this resets WDT. Q: But is watchdog timer also reset after device wakes up from sleep (either via external interrupt or WDT timeout)? The reviewed datasheets and app notes are inconclusive. The only directly relevant info I have found is here and claims (for 12F508A at least): "The WDT is cleared when the device wakes up from SLEEP, regardless of the wake-up source." By common logic, this is how things should work to properly cover all wake up situations (not to ...I'm need my microcontroller to wakeup every 20-30 minutes. During the idle times it will be in sleep mode. I've successfully got the watchdog timer to start the circuit using the watchdog timer interrupt. The datasheet for my microcontroller is here: http://ww1.microchip.com/downloads/e...Doc/41391D.pdf The WDTPS only allows for 256 second delay. See page 99. How can I make a longer delay? I thought about putting 5 of these sleep commands in a row in the code, but the extra power to restart I think would be too much.All, I've got a question regarding the code that's linked to in a few spots on the forums and maybe even in the playground: http://interface.khm.de/index.php/lab/experiments/sleep_watchdog_battery/ From what I can tell, the loop function here is checking if their watchdog flag, f_wdt, is equal to 1, if so it does some stuff like reads a sensor, sets the watchdog flag to 0, and then goes to sleep. The watchdog interrupt function sets the flag to 1, and the whole process starts over again. So my question is this. Does that watchdog timer flag really do anything? They're initializing it to ...I am using a PIC24F16KA301. I am observing the following about Deep Sleep Watchdog Timeout Periods. When I setup for a 528ms timeout, the timeout is 730ms. When I setup for 2.1s timeout, the timeout is 2.8s. When I setup for a 8.5s timeout, the timeout is 11.5s. This is roughly a 4/3 increase in the timeout period. Has anyone heard of this kind of a problem before?Hi guys: I have a doubt about the watchdog functionality. Let's say that I have the watchdog enabled, then during the program I use the instruction sleep and then the instruction nop. Code : (stuff) sleep nop (more stuff) My question is : where does the program continuw after a watchdog interrupt? to the nop instruction or to the program address 0000h? what's the correct way to use the watchdog? t.i.a.Hello, In all of my past experiences with a watchdog timer, the behavioral model has been the following: * Configure the watchdog to certain timeout period. * Call a function to reset the watchdog more frequently than the timeout periond. * If the watchdog is not reset before the timeout period, the processor is reset. I would like to use the watchdog on my LM3S8962. But when I look at the Stellarisware watchdog example, I see that the ampquot;resettingampquot; of the watchdog timer is done in an ISR. This does not seem like a good design ...Hello. I am programming the PIC24F16KA102. I need to know if it is possible to change the FDS Configuration Register by SW. If it is possible I need to change it by SW when the program in running. I need to put the PIC in Deep Sleep Mode when the program is in two different states. In one state, I don't want to enable the Deep Sleep Watchdog Timer, but in the other one it is so neccesary to enable the Deep Sleep Watchdog Timer. For this reason, I configure all the Configure Register with the "wizard" of mikroC. I attach the image (EditProject.jpg). I have disabled ...Hi, In relation to the setting up of using the postscaler for using the watchdog timer for sleep. I'm using the internal oscillator at 4MHz and I have the postscaler set up to 1:256 which I know puts my PIC to sleep for around 4s. I only know this value through trial and error But what I don't know is how to calculate to the postscaler value. Say for example I want the PIC to got to sleep for an hour....what is the formula for finding this out?????.. Could really use some help The PIC I'm using is in the link below (PIC 18f4620) http://ww1.microchip.com/downloads/en/DeviceDoc/39626e.pdfHello all, I am trying to put the PIC to sleep under certain conditions and wake it up every once in a while. WDT seems to be a good choice to wake the PIC up from sleep however when it is not sleeping, it keeps resetting the PIC. I am using delays longer than the WDT overflow time so I need to disable the WDT when I don't want it to reset the PIC. For example when the USB is enumerated it should stay awake. Here is my code:Please suggest a method to test the External Watchdog during each Boot-up of the code. The Problems I am facing are 1) Self Testing Watchdog if proper, gives Reset to the processor. 2) Using no.1, I am not able to differentiate the Power-On reset and Watchdog reset. Some site suggest that one can use the Sleep Mode for testing the Watchdog. Anyone tried this? Thank you in Advance.Hey everyone I have some Assembly code I've been working on over the last couple of days. For the most part, its working. The problem lies with sleep and the PCint. What happens is the watchdog timer kicks the avr out of sleep . I tried adding the following to disable the watchdog timer. Code: LDI r22,0x11 LDI r23,0x00 OUT WDTCR,r22 OUT WDTCR,r23 The datasheet tells to set the WDE bit, then within 4 cycles clear it. The disabling is not occuring . In addition, I enable the PCint on Pins 3 and 2 and set the Global Interrupt. The only ...I recently asked some questions about timings, loops and interupts, with some good responses - however, further reading has raised even more questions. I have noticed that several people refer to the watchdog timing waking up the PIC when in sleep, i thought that the watchdog timer just reset the PIC? Is the internal RC oscillator used for the watchdog also used for anything else, i.e. sleep? Also, if i was to create an application that, for example:- 1, Used TMR1 with an external 32Khz crystal, an the interal RC oscillator for the main program (or even just one oscillator using idle). 2, Had ...Hello, I've read a lot and particularly this thread http://www.microchip.com/...h=timer+sleep+internal I am getting confused about all those RTCC, INTOSC.. here is my question : I would like to get my PIC into deep sleep and wake it up after a certain time, given the fact that I don't want to use any external oscillator.. Is this possible using Timer 1 ? Must I use WDT for this purpose ? What are the drawbacks ? (Power on reset ?) Thank you very much (I have tested a lot of things but I'm completely confused now dealing with ...
