A-6
WDT Programming
WDT Programmi
n
g Guide
1)
Enter extended function mode as mentioned on the previous page.
2)
Program WDT related CR:
a)
CR2C-b[3,2]P[1,0]
; Set pin output as WDT function
b)
CR07-P08h
; Point to LD8
c)
CRF2-Pxyh
; Program WDT time-out period and start count down.
xy = 00 ; No WDT time-out and counting
xy = 01 ; WDT time-out = 30 sec. and starts counting
............
d)
Read CRF4-b0 if needed;
0 : WDT counting
1 : WDT time-out happened
3)
Exit extended function mode as mentioned on the previous page.
Example ( ENABLE WDT AND SET WDT time-out = 1.5 minutes )
Step 1.
MOV DX,3F0H
MOV AL,87H
CLI
; disable interrupt
OUT DX,AL
JMP $+2
OUT DX,AL
STI
; enable interrupt