LPC55S16 Watchdog Warning interrupt

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

LPC55S16 Watchdog Warning interrupt

跳至解决方案
3,291 次查看
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 项奖励
回复
1 解答
3,017 次查看
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 项奖励
回复
5 回复数
3,018 次查看
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 项奖励
回复
3,252 次查看
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 项奖励
回复
3,240 次查看
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 项奖励
回复
3,193 次查看
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 项奖励
回复
3,117 次查看
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 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-1966799%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ELPC55S16%E7%9C%8B%E9%97%A8%E7%8B%97%E8%AD%A6%E5%91%8A%E4%B8%AD%E6%96%AD%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1966799%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%88%91%E7%A1%AE%E5%AE%9E%E4%BF%AE%E6%94%B9%E4%BA%86%20WDT%20%E7%A4%BA%E4%BE%8B%E4%BB%A5%E5%9C%A8%20CPU%20%E9%87%8D%E7%BD%AE%E4%B9%8B%E5%89%8D%E7%94%9F%E6%88%90%E8%AD%A6%E5%91%8A%E4%B8%AD%E6%96%AD%EF%BC%8C%E4%BD%86%E6%88%91%E6%97%A0%E6%B3%95%E8%AE%A9%E7%BB%BF%E8%89%B2%E6%8C%87%E7%A4%BA%E7%81%AF%E4%BA%AE%E8%B5%B7%EF%BC%8C%E4%B9%9F%E6%97%A0%E6%B3%95%E5%9C%A8%20WTD%20%E9%87%8D%E7%BD%AE%20CPU%20%E4%B9%8B%E5%89%8D%E8%B0%83%E7%94%A8%E4%B8%AD%E6%96%AD%E3%80%82%3C%2FP%3E%3CP%3E%E8%AD%A6%E5%91%8A%E9%85%8D%E7%BD%AE%E4%B8%BA%202%20%E7%A7%92%EF%BC%8C%E8%B6%85%E6%97%B6%E9%85%8D%E7%BD%AE%E4%B8%BA%206%20%E7%A7%92%E3%80%82%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%20translate%3D%22no%22%3Econfig.timeoutValue%20%3D%20wdtFreq%20*%206%3B%0Aconfig.warningValue%20%3D%20wdtFreq%20*%202%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CP%3E%E5%A6%82%E6%9E%9C%E6%88%91%E7%A6%81%E7%94%A8%E9%87%8D%E7%BD%AE%EF%BC%8C%E9%82%A3%E4%B9%88%206%20%E7%A7%92%E5%90%8E%E5%B0%B1%E4%BC%9A%E8%B0%83%E7%94%A8%E4%B8%AD%E6%96%AD%EF%BC%8C%E5%B9%B6%E8%AE%BE%E7%BD%AE%E8%AD%A6%E5%91%8A%E6%A0%87%E5%BF%97%E8%80%8C%E4%B8%8D%E6%98%AF%E8%B6%85%E6%97%B6%E6%A0%87%E5%BF%97%E3%80%82%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%E6%9C%89%E4%BA%BA%E8%83%BD%E5%B8%AE%E6%88%91%E8%A7%A3%E5%86%B3%E8%BF%99%E4%B8%AA%E9%97%AE%E9%A2%98%E5%90%97%EF%BC%9F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1987809%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9ALPC55S16%E7%9C%8B%E9%97%A8%E7%8B%97%E8%AD%A6%E5%91%8A%E4%B8%AD%E6%96%AD%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1987809%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CBR%20%2F%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%20translate%3D%22no%22%3ECLOCK_SetClkDiv(kCLOCK_DivWdtClk%2C%2064U%2C%20true)%3B%0A%0Aconfig.warningValue%20%3D%200x3FF%3B%E2%80%8B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%E4%BD%A0%E6%98%AF%E5%AF%B9%E7%9A%84%EF%BC%8C%E4%B8%AD%E6%96%AD%E6%AD%A3%E5%9C%A8%E5%B7%A5%E4%BD%9C%EF%BC%8C%E4%BD%86%E6%98%AF%E4%B8%AD%E6%96%AD%E5%92%8C%E7%9C%8B%E9%97%A8%E7%8B%97%E5%A4%8D%E4%BD%8D%E4%B9%8B%E9%97%B4%E7%9A%84%E6%97%B6%E9%97%B4%E9%97%B4%E9%9A%94%E5%A4%AA%E7%9F%AD%E4%BA%86%EF%BC%8C%E6%88%91%E6%B2%A1%E6%9C%89%E6%B3%A8%E6%84%8F%E5%88%B0%E4%BB%96%E7%9A%84%20LED%20%E4%BD%95%E6%97%B6%E4%BA%AE%E8%B5%B7%EF%BC%8C%E4%BB%A5%E5%8F%8A%E5%BD%93%E7%9C%8B%E9%97%A8%E7%8B%97%E5%A4%8D%E4%BD%8D%E7%94%B5%E8%B7%AF%E6%9D%BF%E6%97%B6%20LED%20%E5%86%8D%E6%AC%A1%E7%86%84%E7%81%AD%EF%BC%8C%E5%B9%B6%E4%B8%94%E7%94%B1%E4%BA%8E%E5%90%8C%E6%A0%B7%E7%9A%84%E5%8E%9F%E5%9B%A0%EF%BC%8C%E8%B0%83%E8%AF%95%E5%99%A8%E4%B9%9F%E6%B2%A1%E6%9C%89%E5%9C%A8%E4%B8%AD%E6%96%AD%E4%B8%AD%E5%81%9C%E6%AD%A2%E3%80%82%3C%2FP%3E%3CBR%20%2F%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%E5%B0%86%E8%AE%A1%E6%97%B6%E5%99%A8%E7%9A%84%E5%88%86%E9%A2%91%E5%99%A8%E8%AE%BE%E7%BD%AE%E4%B8%BA%E6%9C%80%E5%A4%A7%E5%80%BC%2064%EF%BC%8C%E5%B9%B6%E5%B0%86%E8%AD%A6%E5%91%8A%E5%80%BC%E8%AE%BE%E7%BD%AE%E4%B8%BA%E6%9C%80%E5%A4%A7%E5%80%BC%201023%20%E5%90%8E%EF%BC%8C%E8%B0%83%E8%AF%95%E5%99%A8%E7%A1%AE%E5%AE%9E%E5%9C%A8%E4%B8%AD%E6%96%AD%E4%B8%AD%E5%81%9C%E6%AD%A2%E3%80%82%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%E5%86%8D%E6%AC%A1%E6%84%9F%E8%B0%A2%E6%82%A8%E7%9A%84%E5%B8%AE%E5%8A%A9%E3%80%82%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1969012%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9ALPC55S16%E7%9C%8B%E9%97%A8%E7%8B%97%E8%AD%A6%E5%91%8A%E4%B8%AD%E6%96%AD%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1969012%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E7%BB%93%E6%9E%9C%E7%9B%B8%E5%90%8C%EF%BC%8C%E4%BD%86%E6%97%B6%E9%97%B4%E5%BB%B6%E9%95%BF%E4%BA%86%204%20%E5%80%8D%E3%80%82%3CBR%20%2F%3E%E4%BD%A0%E7%A1%AE%E5%AE%9E%E4%BA%86%E8%A7%A3%E6%88%91%E7%9A%84%E9%97%AE%E9%A2%98%E5%90%A7%EF%BC%9F%3CBR%20%2F%3EWTD%20%E8%AD%A6%E5%91%8A%E4%B8%AD%E6%96%AD%E6%9C%AA%E6%8C%89%E9%A2%84%E6%9C%9F%E8%B0%83%E7%94%A8%E3%80%82%3C%2FLINGO-BODY%3E