Archives
-
STR75x Watchdog in Free-Running Timer Mode
I am developing an application with STR750 and I use the watchdog timer in watchdog mode.
I have to fix a watchdog issue and find where my application code in some working conditions stops refreshing the watchdog timer.
So I changed the watchdog in timer mode, in order to get a FIQ interrupt when that issue occurs.
The following is my code:
void WDG_Configuration(void)
{
WDG_InitTypeDef WDG_InitStructure;
EIC_FIQInitTypeDef EIC_FIQInitStructure;WDG_DeInit();
/* Configure the WDG to generate a FIQ interrupt */
WDG_InitStructure.WDG_Mode = WDG_Mode_Timer;
WDG_InitStructure.WDG_Preload = 0xFFFF;
WDG_InitStructure.WDG_Prescaler = 0xFF;
WDG_Init(ampWDG_InitStructure);
/* Enable the WDG */
WDG_Cmd(ENABLE);WDG_ClearITPendingBit();
/* Enables the WDG End of Count(EC) interrupt */
WDG_ITConfig(ENABLE);EIC_FIQInitStructure.EIC_FIQChannel = WATCHDOG_FIQChannel;
EIC_FIQInitStructure.EIC_FIQChannelCmd = ENABLE;
EIC_FIQInit(ampEIC_FIQInitStructure);
EIC_ClearFIQPendingBit(WATCHDOG_FIQChannel);
/* Enable the Interrupt controller to manage FIQ channel*/
EIC_FIQCmd(ENABLE);
}
void WdogRefresh( void )
{
WDG_ClearFlag();
WDG_Cmd(ENABLE);
}void FIQ_Handler(void)
{
unsigned char fiq_pend = (unsigned char)(EIC-gtFIPR);if( fiq_pend amp 0×02 )
{
/* Clear the FIQ pending bit for Watchdog */
EIC-gtFIPR = 0×00000002 ;
if( (WDG-gtSR amp 0×0001) ampamp (WDG-gtMR amp 0×0001) )
{
/* Clear the EC pending bit */
WDG-gtSR amp= ~0×0001;/* Stop timer by clearing SC bit in Control register */
WDG-gtCR amp= 0xFFFD;// endless loop for debbugging purpose
while(1);
}
}if( fiq_pend amp 0×01 )
{
/* Clear the FIQ pending bit for EXTINT0 */
EIC-gtFIPR = 0×00000001 ;
}
}
Well, when my application start running after watchdog initialization I get a FIQ interrupt for watchdog End of Count. Actually the EC flag in WDG Status Register is high: how can it be possible? Is my WdogRefresh() function wrong?
I have no watchdog reset at application startup when the watchdog timer is in watchdog mode …Is there any appnote regarding the use of STR75x watchdog timer in timer mode?
Waiting your kind help to resolve this issue … thanks!
Related Forum Messages
- Watchdog timer not running
- Cant STOP Watchdog
- Simple watchdog set-up query
- Stellaris Watchdog
- AVR Built in WatchDog Timer Reliability
- Watchdog reset using C32 v2.00 compiler
- Watchdog Timer and Sleep Modes
- Using the watchdog to wake up from sleep
- watchdog of AT91SAM7x256
- Watchdog relation and interrupt 0
- WDT and Sleep Modes
- DFU upgrade via the boot loader and watchdog
- Watchdog Timer of ADUC842
- at91sam7x256 watchdog issue
- Watchdog problem with AVR bootloader
- 18F8277 WatchDog disable kills timer0?
- Problem with watchdog
- Watchdog Interrupt Call Procedure? Mega168
- Watchdog timer problem of dspic30f4011
- Watchdog helps
Hi all, i'm quite new with AT91. Hope can get helps from you all... Currently I'm using AT91SAM7S256 for my project... and planning to use the watchdog to reset the system when the software hanged. I had went through the database search, and did the same things.. but doesnt working.. As mentioned in datasheet, the watchdog is using slow clock at 32.768kHz. Would like to double confirm whether I need to set any clocks in order to get the slow clock run at 32.768kHz as needed for watchdog. If yes, what is the sequence to configure the clock properly? Below is my code. Does the watchdog ...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 all, I am using an ATMEGA 88pa controller at 8Mhz clock internal frequency. I am trying to use the watchdog in interrupt mode to toggle an LED. I was reading the datasheet where I came across this statement under the WDIE enable bit section in WDTCSR register: Quote: When this bit is written to one and the I-bit in the Status Register is set, the Watchdog Interrupt is enabled. If WDE is cleared in combination with this setting, the Watchdog Timer is in Interrupt Mode, and the corresponding interrupt is executed if time-out in the Watchdog Timer occurs. Now to ...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 ...Hi all, I am developing an application for Elevator Control, and I want a reliable WatchDog timer, I had a bad experiance when I was working with PIC mircocontroller that on power up the PIC didnt make self reset and also the watchdog timer didnt reset the PIC even the WatchDog was Enabled by Fuse(not by the software), my current design is using ATMEGA8, I am afraid this problem may occar with the ATMEGA8, so I made a design for a hardware WatchDog timer, but this will take more area on the PCB, so I need your advice, can I ...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 ...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, all The watchdog puzzled me for several days, why the watchdog doesn't reset after following initialization void watchdog_init(void) { AT91F_WDTC_CfgPMC(); AT91C_BASE_WDTC-gtWDTC_WDMR = AT91C_WDTC_WDV|AT91C_WDTC_WDD|AT91C_WDTC_WDRSTEN|AT91C_WDTC_WDIDLEHLT||AT91C_WDTC_WDDBGHLT; } but if I change "WDT_MR_Val EQU 0x00008000" to "0x3FFF2FFF" in "SAM.s", the watchdog is ok... I notice "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." but i'm not very clear about it, if WDT_MR can be written only once, what does reloads means??? hlps, thanksHello, 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 ...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 ...Hi all. First of all, we are using a LM3S9B90 Rev. C3 and StellarisWare rev. 6852. Our application is using a watchdog, which is working fine. However, whenever I enter DFU mode (using the USB capable boot loader), this is done by calling USBDDFUUpdateBegin(), and the device enters DFU mode without being reset. This causes an issue, as the watchdog is not disabled, and will, when it counts down, reset the MCU. Once enabled, there is no possibility to disable the watchdog, and issuing WatchdogResetDisable(WATCHDOG0_BASE) causes an error. How can we prevent the watchdog from resetting the MCU while in ...Dear sir, I am using ADUC842 for my design. I want to set watchdog timer of 2 sec for any errorneous condition. In my main function, i have enabled all interrupts already... I need to configure watchdog timer. But before that i should disable all the interrupts,set the watchdog timer and again enable the interrupts. since i have enabled all interrupts,i cant configure watchdog timer in the main function. where should i configure the watchdog timer ? pls help. Regards, Mayuri GHi, 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). ...i am working with some equipment from Libelium (waspmotes) which doesnt seem to allow me to use a watchdog in the reset mode but will work in interrupt mode. What I'd like to know is whether there is a better way to do a reset as soft reset isnt really whats needed - also does anyone know why a bootloader can stop a watchdog from doing a reset !!!???? Here is some code that works for a soft watchdog obviously I am trying to find out how this can be improved -e.g. what registers should I also reset and how ...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 ...Greetings. I'm working with the RCM5700 module. I need to use the hardware watchdog timer. Supposedly, the watchdog is always enabled, but I never use the hitwd function to restart it, and my device never restarted. Now. I use the Enable_HW_WDT function to enable the watchdog, but my hardware never restarted. Is there anything I forgot to configure? Please help me. ThanksHey guys (and maybe gals), I was wondering if anyone knows whether the watchdog timer always occurs before a reset? (Obviously if the registers are set to do both) on the mega168. The only reason I ask is that I have had some unexpected events although the watchdog ISR hasn't executed, and I can only assume the watchdog ISR was never called as the reset occurred while in an interrupt. Is this correct as I cant find any information stating this in the manual? Thanks in advance.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 ...my code has structure like this Code: int main(void) { HW_Init(); /* Initialize all Timer's */ Timer_Init(); /* Global Interrupts Enabled */ Interrupt_EN(); ////////////////////////////////////////////////////////////////////////////////////// /* Keyboard Routines Starts Over here */ ...
