User manual

PCM-3343 User Manual 70
C.1 Watchdog Timer and GPIO Sample Code
C.1.1 [PCM-3343 WDT]
Note : Index port(22h) = 13h, Data port(23h) = C5h :
Unlock function port 22h/23h for GPIO/WDT0 works.
Index port(22h) = 13h, Data port(23h) = 00h :
Lock GPIO/WDT0 function.
1. WDT0 GPIO Registers
Index port(22h) = 37h, Data port(23h) definition :
WDT1 control register of bit 6 is enable WDT 1 control
Index port(22h) = 38h, Data port(23h) definition :
WDT1 signal select control register of bit 7-4 set 1101b
as system reset.
Index port(22h) = 39h / 3Ah / 3Bh, Data port(23h) definition :
WDT1 of counter 0~3 register, bit 7-0 resolution is 30.5us.
2. WDT1 GPIO Registers
IO port 68h: WDT1 control register of bit 6 is enable WDT 1 control
IO port 69h: WDT1 signal select control register of bit 7-4 set 1101b
as system reset.
IO port 6Ah / 6Bh / 6Ch : WDT1 of counter 0~3 register, bit 7-0 resolution is 30.5us.
Sample code:
.model small
.286p
.stack
.data
.code
main:
xor al,al ;clear al value
out 68h,al
mov al,0D0h ;Issue system reset
out 69h,al
mov al,00h ;count 0
out 6ah,al
mov al,00h ;count 1
out 6bh,al
mov al,03h ;count 2
out 6ch,al
mov al,040h ;enabled WDT function
out 68h,al
mov ah,4ch
int 21
end
It will reboot after 5 seconds.