AmbiqSuiteSDK icon indicating copy to clipboard operation
AmbiqSuiteSDK copied to clipboard

Watchdog timer 8 vs 16 bit

Open Colin-at-511100471793 opened this issue 4 years ago • 1 comments

misleading documentation issue with am_hal_wdt

looking at the current version of this which I believe uses sdk 2.2

if you look in am_hal_wdt.h then you can see that ui16ResetCount is a 16 bit counter. where the datasheet for the apollo3 it clearly states that it's an 8 bit counter.

if I set up the wdt for 7200(2 hr) seconds with the 1hz counter, I would expect it not to reset if i feed it every hour. What actually happens is that it resets every 32 seconds. that's because 7200 mod 256 is 32.. so the msb's are thrown away..

so if you use this, I think the longest wdt you can make is 16*255=4080 seconds- a bit over an hour.

Colin-at-511100471793 avatar May 22 '20 17:05 Colin-at-511100471793

Thanks @Colin-at-511100471793! Great to have this documentation.

oclyke avatar May 26 '20 16:05 oclyke