K64F watchdog timeout value

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

K64F watchdog timeout value

930 Views
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.

Labels (1)
0 Kudos
Reply
3 Replies

709 Views
unknowncoder
Contributor III

This problem has been resolved. 

There some some incorrect timer calculation occurring in the code.

0 Kudos
Reply

709 Views
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 Kudos
Reply

709 Views
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 Kudos
Reply