Wdt Sample Code - C&T Solution RCO-3200 Series User Manual

Advanced fanless embedded system
Table of Contents

Advertisement

Appendix – WDT & GPIO

WDT Sample Code

SIO_INDEX_Port
equ 04Eh
SIO_DATA_Port equ
04Fh
SIO_UnLock_Value
equ 087h
SIO_Lock_Value equ
0AAh
WatchDog_LDN
equ 007h
WDT_UNIT
equ 60h
WDT_Timer
equ 30
Sample code:
;Enable config mode
mov
dx, SIO_INDEX_Port
mov
al, SIO_UnLock_Value
out
dx, al
jmp
short $+2
jmp
short $+2
out
dx, al
;Change to WDT
mov
dx, SIO_INDEX_Port
mov
al, 07h
out
dx, al
mov
dx, SIO_DATA_Port
mov
al, WatchDog_LDN
out
dx, al
;Acive WDT
mov
dx, SIO_INDEX_Port
mov
al, 30h
out
dx, al
mov
dx, SIO_DATA_Port
in
al, dx
or
al, 01h
out
dx, al
;set timer
mov
dx, SIO_INDEX_Port
mov
al, 0F6h
out
dx, al
mov
dx, SIO_DATA_Port
mov
al, WDT_Timer
out
dx, al
;set UINT
mov
dx, SIO_INDEX_Port
mov
al, 0F5h
out
dx, al
mov
dx, SIO_DATA_Port
mov
al, WDT_UNIT
out
dx, al
;enable reset
mov
dx, SIO_INDEX_Port
mov
al, 0Fah
out
dx, al
mov
dx, SIO_DATA_Port
in
al, dx
or
al, 01h
out
dx, al
;close config mode
mov
dx, SIO_INDEX_Port
mov
al, SIO_Lock_Value
out
dx, al
;60h=second, 68h=minute, 40h=Disabled Watchdog timer
;ex. 30 seconds
;Io_delay
;Io_delay
RCO-3200 | User's Manual
96

Advertisement

Table of Contents
loading

Table of Contents