NEXCOM NISE 101 User Manual

Page 75

Advertising
background image

Copyright © 2010 NEXCOM International Co., Ltd. All Rights Reserved.

62

NISE 101 User Manual

Appendix C: Watchdog Timer Setting

3. Set watchdog timer time-out output as KRST pin (72h).

Register number 72h bit 6

40h : KRST enable (bit 6 = 1)

00h : KRST disable (bit 6 = 0)

ex: outportb(0x02E, 0x072);

outportb(0x02F, (inportb(0x2F) | 40h));

4. Set watchdog timer count mode (second or minute) to register (72h).

Register number 72h bit 7

80h : second mode (bit 7 = 1)

00h : minute mode (bit 7 = 0)

ex: outportb(0x02E, 0x072);

outportb(0x02F, (inportb(0x2F) | 80h));

5. Write time-out value (01h ~ FFh) to timer register (73h).

Register number 73h

00h : Time-out Disable

01h : Time-out occurs after 1 second or minute

02h : Time-out occurs after 2 seconds or minutes

03h : Time-out occurs after 3 seconds or minutes

04h : Time-out occurs after 4 seconds or minutes

05h : Time-out occurs after 5 seconds or minutes

FFh : Time-out occurs after 255 seconds or minutes

write register number 73h to port 02Eh

write time-out value to port 02Fh

ex: outportb(0x02E, 0x73); /* register 73 (Watchdog Timer) */

outportb(0x02F, 0x0A); /* time-out value 0A == 10 seconds */

6. Lock the IT8712F I/O chip, exit the configuration mode

write lock value (02h) to port 02Eh

ex: outportb(0x02E, 0x02);

The following shows two examples of programming the watchdog timer
with 10 seconds time interval in both Micro-assembly and C language.

Demo Porgram 1 (assember language):
;;====================================================
;; Title : NISB101 WatchDog Timer Demo Program (10 seconds)
;; Date : 02/18/2009
;;====================================================
.model small
.code
CONFIG_PORT DW 02EH
UNLOCK_KEY DB 087h,001h,055h,055h
LOCK_KEY DB 002H
;;---------------------------------------------------
;; Main Program start
;;---------------------------------------------------
WatchDog PROC
call Enter_Config_Mode ;; Enter SuperIO Chip config mode
mov cl, 7 ;; Enter Logic Device 7
call Set_Logic_Device

;; Set Watchdog Timer Output as KRST Pin (72H,Bit6) 1 = enable, 0 = dis-
able
mov cl, 072h ;; Register 72h
call Superio_Get_Reg

Advertising