NAR-5050/5070 Series User
’
s Manual
27
;
Enable WDT Step 3 : Read SWC I/O Base Address
; ( Index-60h contains A15---A8, Index-61h contains A7---A0 )
mov dx,Index_IO_Port
; Read Index 60h
mov al,60h
out dx,al
mov dx,Data_IO_Port
in al,dx
mov bh,al
; High Byte I/O Base Addr --> BH
mov dx,Index_IO_Port
mov al,61h
; Read Index 61h
out dx,al
mov dx,Data_IO_Port
in al,dx
mov bl,al
; Low Byte I/O Base Addr --> BL
mov dx,bx
; Load Base Addr to DX
;
Enable WDT Step 4 : Select Bank3 of SWC ( Offset-0fh_Bit[1,0]P[1,1] )
add dx,0fh
; Point to ( I/O Base Addr + 0fh )
in al,dx
; Read this I/O port value first
or al,03
; Select Bank 3 of SWC
out dx,al
sub dx,0fh
; dx back to I/O base Addr.
;
Enable WDT Step 5 : Program WDTO,Twd. ( Offset-11h )
; Write Twd before enabling all WDT enable bits
xor bx,bx
mov bl,WDTO
add dx,bx
; Point to WDTO offset
mov al,ch
; Write the Twd value in minutes
out dx,al
sub dx,bx
; dx back to I/O base Addr.
;
Enable WDT Step 6 : 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