Archives
-
Analog watchdog not working the second time
I’m having some difficulty with getting the analog watchdog to work a second time. I am able to use it the first time correctly, but I think I might be missing something either when I disable it, or re-enable it because as soon as I start up the AWD the second time, the interrupt fires immediately even though the current ADC value no where near the AWD range I am specifying.
Startup code (Most of the time I do a single ADC read so we default to that):
01./* Initialize ADC defaults */Related Forum Messages
- Watchdog reset using C32 v2.00 compiler
- AT91SAM9263– watchdog enabling
- Using the watchdog to wake up from sleep
- Add Assembly Language Code Before CCS sets up C run time env
- Using watchdog as a watchdog
- Watchdog, strange behavior
- 18F8277 WatchDog disable kills timer0?
- Cant STOP Watchdog
- Waking from two int sources (watchdog and external INT)
- How do I setup and use the watchdog?
- ATmega168 watchdog too fast
- Re: How does this C segment work?
- at91sam7x256 watchdog issue
- Watchdog relation and interrupt 0
- Triggering Interrupts with Real Time Clock
- Watchdog reset question.
- Watchdog in ATmega1281V
- ADC and Analog Comparator at the same time?
- Make sure you disable the watchdog at start up…
- Write our own Watchdog function..?
Compiling an existing PIC32 project using the v2.00 C compiler produces a continual watchdog reset. This problem does not appear using the previous v1.12 compiler. Changing the watchdog postscaler value (up to 1048 seconds) has no effect. The watchdog reset occurs almost immediately after startup, definitely not enough time for the timer to expire. Disabling the watchdog allows the code to run as expected. There was a change to the startup code in v2.00, but I am not using any custom startup code to my knowledge. Could there be a problem with the timer used by the watchdog not being ...Hi, Iam using at91sam9263 with bootstrap and uboot in dataflash and linux kernel and rootfs in nand flash. whenever i load the driver at91sam9_wdt.ko it says that watchdog is already initialised. I came to know that in bootstrap is disabled by default. at91sam9263ek.c file hw_init /* Disable watchdog */ writel(AT91C_WDTC_WDRSTT,AT91C_BASE_WDTC + WDTC_WDCR); i commented this line so that i can enable the watchdog at the later time. but by default watchdog is enabled and resets the processor every 16 seconds. also we can write to the watchdog mode register only once. how to disable the watchdog until kernel boots up ...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() { ...I need to add code to enable the watchdog timer and set up low voltage detect that executes immediately just after the microcontroller is reset. I cannot wait for CCS to setup the C run time environment, initialize the variables, etc, etc. Setting up the watchdog must come first. This is to eliminate an EMI compliance issue. How do I accomplish this?Hello everyone, I would like to use the watchdog as a watchdog, instead of as a timer. Meaning I would like to set the watchdog timer to a certain time and if I do not disable it before the time expires, it should reset the MCU. Does anyone have an example code for this? GreetingsI am working on a program for an 18LF45K22 using the CCS compiler. There is one section of the code where I go into an infinite loop with a while(1) and I want the watchdog to time out and reset the CPU. Immedaitely before the code hits the while(1) I disable global interrupts. For some reason the watchdog will never time out and reset unless I take out the disable global interrupts. The watchdog works just as expected if the global interrupts are enabled when it hits the while(1). I could find nothing in the documentation to indicate why the ...New here, but not my first rodeo.. I am working on a rather complex program that uses the Watchdog timer for its obvious uses. Timer0 is also used to generate interrupts for the system clock. I need to be able to disable the Watchdog via a command from another system so that both systems can be reburned in the field. The watchdog is under software enable via the swdten bit (and this is working). When I disable the watchdog, the interrupts from timer0 also stop. I have even added code to enable timer0 immediately after resetting the swdten bit, to ...Im using a m1284. START Watchdog is working but once startet, the watchdog cant be stopped. I tried STOP Watchdog.... The sequence: Clear_Watchdog: 'this sub toggles the watchdog into and out of interrupt / reset mode 'this ensures that no matter what mode the watchdog might have been in previously... 'it will be turned off completely CLI 'disable global interrupts WDR 'reset watchdog timer IN R16, MCUSR 'get MCUSR ANDI R16, $F7 'clear the watchdog reset bit in the status reg !OUT MCUSR, R16 'store MCUSR LDS R16, WDTCSR 'get current watchdog setting LDI R17, $58 'load int/res mode value ...Hello, I am using Atmega328 in SLEEP_MODE_PWR_DOWN with two INT sources for waking up. I need to wake up aperiodically (external INT from a sensor device) and periodically (watchdog 8 s timeout interrupt). I'm having problems setting this up. If I use only one wake-up INT source (sensor) everything works great. However, if I use the watchdog as well, sometimes when a sensor INT wakes the ATmega, the code after sleep_cpu(); command executes multiple times. Sometimes means e.g. 20% of the time. Besides this issue, I am worried about one more thing. If a sensor ext. interrupt occurs- I want ...Is there and example to demonstrate using the watchdog on a pic32? The example that came with the compiler does reboot but as there's no watchdog clearing going on it's not that good an example to learn from. I've read the app notes and the datasheet and looked at various posts both here and on other sites but I don't seen to get anything other than a reboot immediately I try to reset the watchdog in my main loop, on one post I read that was what happens when the watchdog is 'windowed'. I've tried resetting the windowing bit in WDTCON even ...Hi, for testing the watchdog I setup an ATmega168 (straight from the shop, no fuses changed) on a breadboard with an LED attached to pin PC5. For the test I used the following sniplet to toggle the pin everytime the watchdog fires which I set to 8 seconds: Code: Select all #include ltavr/interrupt.hgt #include ltavr/io.hgt int main(void) { DDRC |= _BV(PC5); // enable toggle LED sei(); ...The WDTCSR is the WatchDog Timer Control Register. Each of it's eight named bits means something different. WDE is the WatchDog Enable bit, and WDP0, WDP1, WDP2 and WDP3 are the WatchDog Prescale bits. They are used to select (effectively) the time-out on the WatchDog. The combination of WDP1 and WDP0 indicate that the timeout should be about half a second.Hi, i'm working on a AT91SAM7X-EK development board, and i'm trying to figure out if the normal at91 watchdog behavior can be changed or workarounded because: "The Watchdog Mode Register (WDT_MR) can be written only once. Only a processor reset resets it. Writing the WDT_MR register reloads the timer with the newly programmed mode parameters." due to this feature, if i disable watchdog on start up, i'm not able to turn in on anymore until the next reset. What i want to do is disable watchdog on startup, and then turn it on later (on a custom received can message). ...Hello, I have a problem when i disable the watchdog // WDTCN = 0x0DE; // WDTCN = 0x0AD; at the begining of the main. I put a breakpoint at the external interrupt 0. It will never go in and stop at the breakpoint. When i stop the program. I will stay inside the while loop and I checked the interrupt peripheral, it seems that interrupt 0 has been requested. This problem will not happen when I enable the watchdog in the begining of the main. WDTCN = 0xFF; // lock out the watchdog disable feature WDTCN = 0xA5; // enable ...How would I use a RTC (such as the DS1307) to trigger an interrupt? The overall goal is to put the processor to sleep and then wake it after an hour or so. I looked at using a watchdog timer, but it only goes up to 8 seconds and is reportedly unreliable. Other info: Data logging kit w/ RTC - http://www.adafruit.com/products/243 Fourm post that alludes to using an RTC as an interrupt - http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1291420085 Watchdog tutorial - http://interface.khm.de/index.php/lab/experiments/sleep_watchdog_battery/ RTClib - https://github.com/adafruit/RTClib To clarify, I understand how interrupts work; I just don't know how to implement one using the RTC. I don't get how the interrupt ...I'm using the AT91SAM7SE512. The watchdog is running with a time period of two seconds. In the initialisation code I can detect a watchdog reset (together with all the other types). My question is this:- if a watchdog reset happens is there anyway of knowing where the processor was just before the watchdog kicked in? Of course, I've read the datasheet but there is no mention of a separate register etc. that holds the program counter nor any other information that I can find. Any thoughts? Petehello i am trying to use the watchdog in the interrupt mode only to wake up the ATmega1281V . It's work but only with a delay fixe at 15ms . I have trying to modifie the watchdog prescaler by the bits WDP3,WDP2,WDP1, WDP0 but there are no modification about the time . I use AVR Studio 4 and write in C . Thanks for your help . fredericOn the AT90PWM3B, is it possible to use the ADC and the Analog Comparator at the same time on the same pin? For example, ADC2 and ACMP2 share a pin, and ADC10 and ACMP1 also share a pin. I'd like to be able to read a voltage on those pins with the ADC, and also get an interrupt immediately if that voltage exceeds a certain value. I can't find anything in the datasheet that suggests it won't work, but I have a nagging doubt that there might be some kind of mux which directs the pin to either the ADC ...Hi Everyone, From now on this is going to be the way I start a project - putting in code to disable the watchdog at start up. Twice now during debugging/testing, I've had a project stop working properly only to put some debug code in that turns on a light to watch it blink quickly because the chip is resetting from the watch dog. For some odd reason this did now work on a mega328p: Code: //disable watchdog if enabled wdt_reset(); wdt_disable(); but this did: Code: ...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 ...
