Watchdog Program Example - Advantech PPC-3211SW User Manual

Intel core i processor based panel pc with 21.5"/18.5"/15.6" color tft lcd display
Hide thumbs Also See for PPC-3211SW:
Table of Contents

Advertisement

C.1

Watchdog Program Example

The watchdog timer is provided to ensure that standalone systems can always
recover from catastrophic CPU failures and crashes. Such events may have been
caused by external EMI or a software bug. If the CPU is malfunctioning, the watch-
dog timer performs a hardware reset to return the system to a previous state.
The following watchdog timer example code is written in Intel 8086 assembly lan-
guage for a DOS environment. The number of watchdog timer intervals can be set as
0 ~ 255 via software.
-----------------------------------------------------
; Enter the Extended Function Mode
;-----------------------------------------------------
MOV DX, 2EH; dependency by HW strap to 2Eh
MOV AL, 87H
OUT DX, AL
OUT DX, AL
;-----------------------------------------------------------------------------
; Configure logical device 8, configuration register CR30
;-----------------------------------------------------------------------------
MOV DX, 2EH
MOV AL, 07H
OUT DX, AL; point to logical device number reg.
MOV DX, 2FH
MOV AL, 08H
OUT DX, AL; select logical device 8
;-----------------------------------------------------------------------------
;Set WDT logic device to active
;-----------------------------------------------------------------------------
MOV DX, 2EH
MOV AL, 30H
OUT DX, AL; select CR30
MOV DX, 2FH
MOV AL, 01H
OUT DX, AL; set WDT active
;-----------------------------------------------------------------------------
;Initial WDT mode
;-----------------------------------------------------------------------------
MOV DX, 2EH
MOV AL, F0H
OUT DX, AL
MOV DX, 2FH
MOV AL, 00H; bit 0: 0 = pulse mode, 1 = level mode; bit 3: 0 = second mode, 1 =
minute mode
OUT DX, AL; set second mode, default value
PPC-3211SW/3181SW/3151SW User Manual
50

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ppc-3181swPpc-3151sw

Table of Contents