NAR-5050/5070 Series User
’
s Manual
31
mov al,ch
; Write the Twd value in minutes
out dx,al
sub dx,bx
; dx back to I/O base Addr.
;
Refresh WDT Step 8 : Enable WDEN ( Offset-10h_Bit0P1 )
;Enable WDT Function, Once set, can not be cleared except reset
xor bx,bx
mov bl,WDCTL
add dx,bx
; Point to WDCTL offset
in al,dx
; Read this I/O port value first
or al,01h
; WDCTL_bit0P1. ( Set WDEN )
out dx,al
sub dx,bx
; dx back to I/O base Addr.
;
Refresh WDT Step 9 : Enable SW_WD_TREN ( Offset-12h_Bit7P1 )
;Allow S/W to trigger WDT
xor bx,bx
mov bl,WDCFG
add dx,bx
; Point to WDCFG offset
in al,dx
; Read this I/O port value first
or al,80h
; WDCFG_bit7P1. ( Set SW_WD_TREN )
out dx,al
sub dx,bx
; dx back to I/O base Addr.
;
Refresh WDT Step 10 : Enable SW_WD_TRG ( Offset-10h_Bit7P1 )
,
;Reload Twd,and start count down.
xor bx,bx
mov bl,WDCTL
add dx,bx ; Point to WDCTL offset
in al,dx ; Read this I/O port value first
or al,80h ; WDCTL_bit7P1. ( Set SW_WD_TRG )
out dx,al
sub dx,bx ; dx back to I/O base Addr.
pop bx
pop cx
pop ax
pop dx
ret
WDT refresh ENDP
WDT Disable
; Index_IO_Port dw 002Eh