Example: disable watchdog – Kontron MSM-LP Manual User Guide V106 User Manual
Page 32
MSM-LP / Special Features
www.kontron.com
28
Example: Disable Watchdog
; Watchdog device activation
mov dx, 4Eh
; Store port in dx for in/out instruction
mov al, 77h
; Configuration mode value
out dx, al
; Output 2 times to enter config mode
out dx, al
;
mov al, 07h
; Device number register
out dx, al
; Move value to IND register
inc dx
; Increment dx to DAT register = 0x4F
mov al, 08h
; Device number 8 - watchdog
out dx, al
; Set DAT register
dec dx
; Decrement dx to IND register
mov al, 0F1h
; WDT_CNT register
out dx, al
; Move value to IND register
inc dx
; Increment dx to DAT register 0x4F address
mov al, 0
; Set Timer to 10 second interval
out dx, al
; Set DAT register 2 times to disable watchdog
out dx, al
;
dec dx
; Decrement dx to IND register
mov al, 30h
; Activation register address = 0x30
out dx, al
; Move value to IND register
inc dx
; Increment dx to DAT register
mov al, 0h
; Deactivation value WDT_EN = 0
out dx, al
; Set DAT register – enable watchdog device
dec dx
; Decrement dx to IND register to 0x4E address
mov al, 0AAh
; Leave configuration mode
out dx, al
; Move value to IND register
In C language:
outportb(0x4E,0x77); //output 2 times to enter configuration mode
outportb(0x4E,0x77);
outportb(0x4E,0x7);
//device index
outportb(0x4F,0x8);
//device number 8
outportb(0x4E,0xF1); //WDT_CNT register
outportb(0x4F,0);
// Set Timer to 0, 2 times
outportb(0x4F,0);
//
outportb(0x4E,0x30); //activation register
outportb(0x4F,0x00); //deactivate watchdog WDT_EN = 0
outportb(0x4E,0xAA); //Leave configuration mode