Content originally posted in LPCWare by Thucydides on Wed May 30 10:23:10 MST 2012
Quote: Zero
This time:
#define WDT_FEED_VALUE 78*256*4
is generating a 78*256*4[COLOR=Red]*4[/COLOR] = 319488 timer.
If it's clocked with 78Hz, your WDT resets after 319488 / 78 s = 4096 s = [COLOR=Red]1 hour, 8 minutes[/COLOR][COLOR=Black] :eek:
I would strongly recommend to use 7.8kHz without divider :)
There your minimal reset time is 256*4 / 7800 s = 0.13 s
and your maximal reset time 2^24 * 4 / 7800 s = 2.38 hours
[/COLOR]
Thank you for your advice.
Yes it was my misunderstanding to multiply WDCLK value.
And I thought that WDT_FEED_VALUE must be 7800 if I need 4 sec WDT.
But my expectation was fully betrayed.
I added 1 sec timer and I measured after how many second WDT work.
Under the condition WDT_FEED_VALUE=7800, the WDT didn't seem to work at least within few minutes.
So I increased the WDT_FEED_VALUE 1 by 1 from 256.
The result was as followings.
WDT_FEED_VALUE=275 : WDT started about 1 sec after
WDT_FEED_VALUE=276 : about 2 secs
WDT_FEED_VALUE=277 to 280 : about 10 secs
Someone explains the cause of this result?? and I hope someone checks in real.
Thanks,