Watchdog timer in K22FN

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

Watchdog timer in K22FN

跳至解决方案
966 次查看
thiagopalmieri
Contributor III

Hello,

Just a simple question, how can I calculate the timer value for the watchdog in K22?

From the API, I can see that by default uses the LPO clock, which is rated as 1KHz. The timeout value from the wdog_config_t struct is uint32_t so it can hold up to 0xFFFFFFFFU, or ‭4294967295‬ cycles. The reference manual does not seem to limit the value to something lower than that.

Does that mean that the maximum possible value for the watchdog is ‭4294967 seconds?

If so, from the API documentation, the default value is 0xFFFFU, meaning a default watchdog value of 65 seconds. Is that correct?

Thanks.

标签 (1)
标记 (3)
0 项奖励
1 解答
762 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Thiago,

There is a 3-bit prescaler(WDOG_PRESC) for the watchdog clock source. So you need take it into account.

WDOG_PRESC.png

Best Regards,

Robin

 

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

在原帖中查看解决方案

2 回复数
763 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Thiago,

There is a 3-bit prescaler(WDOG_PRESC) for the watchdog clock source. So you need take it into account.

WDOG_PRESC.png

Best Regards,

Robin

 

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

762 次查看
thiagopalmieri
Contributor III

Ok, so considering a prescaler of 1, putting 3000 into the timeout value, will give me a 3 second watchdog.

Thanks 

0 项奖励