Appendix B: Quickbasic Example - B&B Electronics PC Watchdog Timer Card ATRWDT User Manual

Pc watchdog timer card
Table of Contents

Advertisement

Appendix B: QuickBASIC Example

Note: An additional test program for the WDT is available on
B&B's ftp site at ftp.bb-elec.com/bb-elec/software.
B&B Electronics Mfg. Co.
Watchdog Timer QuickBASIC Example Program
This code is an example of how the WDT is addressed from
within a program. This code would be used when the TIMER RESET
INPUT jumper is in the "CODE" position.
PCWDTaddress = &H300
LatchValue = &H7
'Main loop of your program
DO WHILE INKEY$ = ""
OUT PCWDTaddress, LatchValue
X = inp(PCWDTaddress)
X = X AND 31
Print HEX$(X)
LOOP
Start = TIMER
DO WHILE INKEY$ = ""
Print using "###.#"; (TIMER – Start):Print " Seconds"
LOOP
X = inp(PCWDTaddress)
X = X AND 31
Print HEX$(X)
OUT PCWDTaddress, 0
END
Documentation Number ATxWDT-1303
'hex address chosen for the PCWDT
'hex latch value chosen, in this
'case about a 16 second timeout
'repeat loop until keypressed
'This statement must be executed
'within the timeout period (17
'seconds for this example) or the
'PCWDT will reboot the computer.
'this statement reads the WDT
'registers
'This Statement masks out the 5
'Least Significant bits
'convert to hex
'start the timer
'loop to print time for timeout
'disable PCWDT before ending
Appendix B
B-1

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pc watchdog timer card atxwdtAtrwdtAtxwdt

Table of Contents