Appendix a - watchdog sample code, Watchdog timer – DFI CA331-NR User Manual

Page 124

Advertising
background image

124

A

Watchdog Timer

Appendix A - Watchdog Sample Code

;Software programming example:

;----------------------------------------------------------------
;(1) Enter Superio Configuration mode
;----------------------------------------------------------------
MOV

DX,4EH

MOV

AL,87H

OUT

DX,AL

OUT

DX,AL

;--------------------------------------------------------------------------------
;(2) Configuration Logical Device 8, register CRF5/CRF6/CRF7
; (WDT count mode / count value / control mode)
;--------------------------------------------------------------------------------
MOV

DX,4EH

MOV

AL,07H

;Ready to Program Logical Device

OUT

DX,AL

MOV

DX,4FH

MOV

AL,08H

;Select Logical Device 8

OUT

DX,AL

MOV

DX,4EH

MOV

AL,F5H

;Select CRF5

OUT

DX,AL

MOV

DX,4FH

IN

AL,DX

OR

AL,08H

;Set CRF5[Bit:3]=1, WDT count mode=Minute mode

OUT

DX,AL

MOV

DX,4EH

MOV

AL,F6H

;Select CRF6

OUT

DX,AL

MOV

DX,4FH

MOV

AL,02H

;Set CRF6 value=02 => Watch Dog Timer=2 (unit:Min)

OUT

DX,AL

MOV

DX,4EH

MOV

AL,F7H

;Select CRF7

OUT

DX,AL

Advertising
This manual is related to the following products: