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
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.
This problem has been resolved.
There some some incorrect timer calculation occurring in the code.
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!
-----------------------------------------------------------------------------------------------------------------------
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.