|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2005-6-28 11:21:49
|
显示全部楼层
CONFIG WATCHDOG
Action
Configures the watchdog timer.
Syntax
CONFIG WATCHDOG = time
Remarks
Time The interval constant in mS the watchdog timer will count to before it will reset your program.
Possible settings :
16 , 32, 64 , 128 , 256 , 512 , 1024 and 2048.
When the WD is started, a reset will occur after the specified number of mS.
With 2048, a reset will occur after 2 seconds, so you need to reset the WD in your programs periodically with the RESET WATCHDOG statement.
See also
START WATCHDOG , STOP WATCHDOG , RESET WATCHDOG
Example
'-----------------------------------------------------
' (c) 1999 MCS Electronics
' WATCHD.BAS demonstrates the watchdog timer
'-----------------------------------------------------
Config Watchdog = 2048 'reset after 2048 mSec
Start Watchdog 'start the watchdog timer
Dim I As Word
For I = 1 To 1000
Print I 'print value
'Reset Watchdog
'you will notice that the for next doesnt finish because of the reset
'when you unmark the RESET WATCHDOG statement it will finish because the
'wd-timer is reset before it reaches 2048 msec
Next
End |
|