OpenWatchdog(8/9) Fails

Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
Post Reply
mikep
Posts: 796
Joined: 24 September 2005, 15:54 PM

OpenWatchdog(8/9) Fails

Post by mikep »

The following program works correctly on ZX-24n, ZX-24ne, and ZX-1281e.

Code: Select all

Sub Main()
	Debug.Print "start"
	Call OpenWatchDog(7)
	Do
		Call WatchDog()
		Call Sleep(2.0)
		Debug.Print "wakeup"
	Loop
End Sub
However if 8 or 9 is used as a parameter to OpenWatchdog then the processor continually resets itself.
Mike Perks
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: OpenWatchdog(8/9) Fails

Post by dkinzer »

mikep wrote:However if 8 or 9 is used as a parameter to OpenWatchdog then the processor continually resets itself.
Confirmed. In actuality, 8 and 9 have the same effect as 0 and 1 - too fast for the periodic watchdog resets thus yielding the continual reset behavior observed..

The workaround is to use &H20 and &H21 in place of 8 and 9, respectively.
- Don Kinzer
Post Reply