7. Watch-Dog-Timer (WDT) Setting
72 SPI-8451-LLVA, SPI-8452-LLVA, SPI-8451-LVA
(2) Example programming
The following example is written in Intel8086 assembly language.
;===============
;<WDT Initial>
;===============
;-----------------------------------
;Enter the extended function mode
;-----------------------------------
MOV DX,2EH
MOV AL,87H
OUT DX,AL
OUT DX,AL
;-----------------------------------
;Set WDT function at pin89
;-----------------------------------
MOV DX,2EH
MOV AL,2BH
OUT DX,AL
MOV DX,2FH
MOV AL,0DH
OUT DX,AL
;------------------------------------------------
;Select logical device WDT(number 8)
;-------------------------------------------------
MOV DX,2EH
MOV AL,07H
OUT DX,AL
MOV DX,2FH
MOV AL,08H
OUT DX,AL
;---------------------------------------------------
;Activate logical device WDT(number 8)
;---------------------------------------------------
MOV DX,2EH
MOV AL,30H
OUT DX,AL
MOV DX,2FH
MOV AL,01H
OUT DX,AL
;-----------------------------------
;Set timer unit : second
;-----------------------------------
MOV DX,2EH
MOV AL,F5H
OUT DX,AL
MOV DX,2FH
MOV AL,00H
OUT DX,AL