LPC55S16 Watchdog Warning interrupt

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC55S16 Watchdog Warning interrupt

Jump to solution
297 Views
szempy
Contributor II

I did modify the WDT example to generate a warning interrupt before the CPU is reseted but i couldn't get the GREEN led on or that the interrupt is called before the WTD resets the CPU.

The warning is configured for 2 second and the timeout with 6 seconds.

 

 

config.timeoutValue = wdtFreq * 6;
config.warningValue = wdtFreq * 2;

 

 

If i disable the reset then the interrupt was called after 6 seconds with the warning flag set instead of the timeout flag.

 

Can anyone help me here with this problem?

0 Kudos
Reply
1 Solution
23 Views
szempy
Contributor II

 

CLOCK_SetClkDiv(kCLOCK_DivWdtClk, 64U, true);

config.warningValue = 0x3FF;​

You were right, the interrupt is working, but the time frame between the interrupt and the watchdog reset was so short that I didn't notice when he led turned on and when the watchdog reseted the board the led was off again, and the debugger didn't stop in the interrupt as well for the same reason.

 

 
After putting the divider for the timer to the maximum of 64 and setting the warning value to the maximum 1023 the debugger did stop in the interrupt.
 
 
Thank you for your help again.

View solution in original post

0 Kudos
Reply
5 Replies
24 Views
szempy
Contributor II

 

CLOCK_SetClkDiv(kCLOCK_DivWdtClk, 64U, true);

config.warningValue = 0x3FF;​

You were right, the interrupt is working, but the time frame between the interrupt and the watchdog reset was so short that I didn't notice when he led turned on and when the watchdog reseted the board the led was off again, and the debugger didn't stop in the interrupt as well for the same reason.

 

 
After putting the divider for the timer to the maximum of 64 and setting the warning value to the maximum 1023 the debugger did stop in the interrupt.
 
 
Thank you for your help again.
0 Kudos
Reply
258 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Pls try to enlarge the led on time with the code:
wdtFreq = CLOCK_GetWdtClkFreq() / 1; 
 
what is the result?
 
BR
XiangJun Rong
0 Kudos
Reply
246 Views
szempy
Contributor II
Same result with 4 times longer.
You do understand my problem right?
The WTD warning interrupt is not called as it supposed to be.
0 Kudos
Reply
199 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I have tested your code, these are the register value of WDT.
It appears that you do not set up the WINDOW register, but you use the delayWwdtWindow() condition to feed dog.
am I right?
Note that the WARNINT reg is a 10 bits register
 
 
xiangjun_rong_1-1728639532451.png

 

 

 

void delayWwdtWindow(void)

{

/* For the TV counter register value will decrease after feed watch dog,

* we can use it to as delay. But in user scene, user need feed watch dog

* in the time period after enter Window but before warning intterupt.

*/

while (WWDT->TV > WWDT->WINDOW)

{

__NOP();

}

}

 

You have to set up the TC,WINDOW and WARNINT registers to a proper value. so that the TV can reach down to the WARNINT reg.
 
Pls try to set up the above three reg to a proper value.
Hope it can help you
 
Regard
XiangJun Rong
0 Kudos
Reply
123 Views
szempy
Contributor II

It seams that you don't really understand how this example works.

 

The first time when the program starts the timeOutResetEnable is set to true. If there is a watchdog reset then it will feed the Watchdog.

If the timeOutResetEnable is true then the Watchdog won't be feed.

I have changed now the settings to:

 

 

 

config.timeoutValue = wdtFreq * 6;
config.warningValue = 510;
config.windowValue = wdtFreq * 6;

 

 

So this are the set values:

Screenshot_12.jpg

What i want is that before the processor is resettled that the WDT_BOD_IRQHandler is called and i can do some things before the reset.

Can you give me some example how can achieve that?

0 Kudos
Reply