K64F watchdog timeout value

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

K64F watchdog timeout value

1,407 次查看
unknowncoder
Contributor III

I am having trouble converting millisecond to the watchdog timeout value when using MCUXpresso watchdog driver.

Please validate my math.

One tick of the watchdog = 1 ms. With the given configuration

  • Watchdog clock = kWDOG_LpoClockSource = 1KHz
  • Watchdog prescaler = 1

Therefore when I setup the watchdog I do

wdog_config_t config;

 WDOG_GetDefaultConfig(&config);

config.timeoutValue = 1000;

This should make the watchdog timeout in 1 second but it seem to be timing out alot sooner.

标签 (1)
标记 (3)
0 项奖励
回复
3 回复数

1,186 次查看
unknowncoder
Contributor III

This problem has been resolved. 

There some some incorrect timer calculation occurring in the code.

0 项奖励
回复

1,186 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Desmond,

Would you please tell us how did you see it time out alot sooner?
Maybe you can toggle a pin and then WDOG_Refresh it only once. Measure the Reset_b pin waveform and observe if the voltage will low after 1ms.

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

1,186 次查看
jschepler
Contributor III

Hi Desmond,

Can you show your entire config structure?

If you actually are assigning "1" to you're prescaler value in the config then it will be divided by 2 in the driver.

I am using KSDK 1.3.0 and the ENUM to divide by 1 in the driver is: kWdogClkPrescalerDivide1

The enum value of that is 0.

0 项奖励
回复