0% found this document useful (0 votes)
53 views

Advansus WDT Guide

This document provides information about programming the watchdog timer in the Winbond 83627EHG-A chip. It describes the watchdog timer's functions, registers, and provides examples of code to enable the timer, set the timeout period, and configure interrupt handling and reset signaling. The examples show how to unlock the registers, select the watchdog timer, enable it, set the counting unit to seconds or minutes, set the timeout value, and lock the registers.

Uploaded by

Boudam Boudjema
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views

Advansus WDT Guide

This document provides information about programming the watchdog timer in the Winbond 83627EHG-A chip. It describes the watchdog timer's functions, registers, and provides examples of code to enable the timer, set the timeout period, and configure interrupt handling and reset signaling. The examples show how to unlock the registers, select the watchdog timer, enable it, set the counting unit to seconds or minutes, set the timeout value, and lock the registers.

Uploaded by

Boudam Boudjema
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Appendix

Programming the
Watchdog Timer

1 Appendix A
Programming the watchdog timer

A.1 Programming the Watchdog Timer


This watchdog timer can be used to monitor system software operation
and take corrective action if the software fails to function after the
programmed period. This section describes the operation of the watchdog
timer and how to program it.

A.1.1 Watchdog timer overview


The watchdog timer is built-in the super I/O controller W83627EHG-A.
It provides the following functions for user programming:
• Can be enabled and disabled by user's program
• Timer can be set from 1 to 255 seconds or 1 to 255 minutes
• Generates an interrupt or resets signal if the software fails to reset the
timer after time-out
A.1.2 Programming the Watchdog Timer
The I/O port address of the watchdog timer is 2E (hex) and 2F (hex).
2E (hex) is the address port. 2F (hex) is the data port.
You must first assign the address of register by writing address value
into address port 2E(hex), then write/read data to/from the assigned
register through data port 2F (hex).

Winbond 83627EHG-A Watchdog User’s Guide


Unlock W83627H

Select register of
watchdog timer

Enable the function of


the watchdog timer

Use the function of


the watchdog timer

Lock W83627HF

3 Appendix A
Watchdog Timer Registers

Address of register Attribute


(2E)

Read/Write Value (2F) and


description

87 (hex) ----- Write this address to I/O


address port 2E (hex)
twice to unlock
theW83627HF

07 (hex) write Write 08 (hex) to select


register of watchdog timer.

30 (hex) write Write 01 (hex) to enable


the function of the
watchdog timer. Disabled
is set as default.

F5 (hex)Bit 3: set second write Select WDTO# count


as counting unit mode.
0: Second Mode
1: Minute Mode

F5 (hex)Bit 1: set minute write Disable / Enable the


as counting unit WDTO# output, low pulse
to the KBRST# pin (PIN60)
0: Disable
1: Enable

Winbond 83627EHG-A Watchdog User’s Guide


F6 (hex) write 0: stop timer [default]
01~FF (hex): The amount
of the count, in seconds or
minutes, depends on the
value set in register F5
(hex). This number
decides how long the
watchdog timer waits for
strobe before generating
an interrupt or reset signal.
Writing a new value to this
register can reset the timer
to count with the new
value.

F7 (hex)Bit 7 Read/write Mouse interrupt reset


watch-dog timer enable
0: Watchdog timer is not
affected by mouse
interrupt
1: Watchdog timer is reset
by mouse interrupt

F7 (hex)Bit 6 Read/write Keyboard interrupt reset


watch-dog timer enable
0: Watchdog timer is not
affected by keyboard
interrupt
1: Watchdog timer is reset
by keyboard interrupt

F7 (hex)Bit 5 Read/write Trigger WDTO# event.


This bit is self clearing.

F7 (hex)Bit 4 Read/write WDTO# Status bit


0: Watchdog timer is
running
1: Watchdog timer issues
time-out event

F7 (hex)Bit 3~0 Read/write These bits select IRQ


resource for WDTO# (02h
for SMI# event)
5 Appendix A
AA (hex) ----- Write this address to I/O
port 2E (hex) to lock the
watchdog timer.2

Table A.1: Watchdog timer registers


A.1.3 Example Program
Example1. Enable watchdog timer and set 10 sec. as timeout interval
and issue KBRST#
;-----------------------------------------------------------
Mov dx,2eh ; Unlock W83627HF/EHG-A
Mov al,87h
Out dx,al
Out dx,al
;-----------------------------------------------------------
Mov al,07h ; Select registers of watchdog timer
Out dx,al
Inc dx
Mov al,08h
Out dx,al
;-----------------------------------------------------------
Dec dx ; Enable the function of watchdog timer
Mov al,30h
Out dx,al
Inc dx
Mov al,01h
Out dx,al
;-----------------------------------------------------------
Dec dx ; Set second as counting unit and enalbe the WDTO#
Mov al,0f5h
Out dx,al
Inc dx
In al,dx
Winbond 83627EHG-A Watchdog User’s Guide
And al, 0f7h
Or al,02h
Out dx,al
;-----------------------------------------------------------
Dec dx ; Set timeout interval as 10 seconds and start
counting
Mov al,0f6h
Out dx,al
Inc dx
Mov al,10
Out dx,al
;-----------------------------------------------------------
Dec dx ; lock W83627HF
Mov al,0aah
Out dx,al

Example2. Enable watchdog timer and set 5 minutes as timeout


interval and issue KBRST#
;-----------------------------------------------------------
Mov dx,2eh ; unlock W83627H
Mov al,87h
Out dx,al
Out dx,al
;-----------------------------------------------------------
Mov al,07h ; Select registers of watchdog timer
Out dx,al
Inc dx
Mov al,08h
Out dx,al
;-----------------------------------------------------------
Dec dx ; Enable the function of watchdog timer
7 Appendix A
Mov al,30h
Out dx,al
Inc dx
Mov al,01h
Out dx,al
;-----------------------------------------------------------
Dec dx ; Set minute as counting unit and enable the WDTO#
Mov al,0f5h
Out dx,al
Inc dx
In al,dx
Or al,08h
Or al,02h
Out dx,al
;-----------------------------------------------------------
Dec dx ; Set timeout interval as 5 minutes and start counting
Mov al,0f6h
Out dx,al
Inc dx
Mov al,5
Out dx,al
;-----------------------------------------------------------
Dec dx ; lock W83627HF
Mov al,0aah
Out dx,al

Example3. Enable watchdog timer to be reset by mouse


;-----------------------------------------------------------
Mov dx,2eh ; unlock W83627H
Mov al,87h

Winbond 83627EHG-A Watchdog User’s Guide


Out dx,al
Out dx,al
;-----------------------------------------------------------
Mov al,07h ; Select registers of watchdog timer
Out dx,al
Inc dx
Mov al,08h
Out dx,al
;-----------------------------------------------------------
Dec dx ; Enable the function of watchdog timer
Mov al,30h
Out dx,al
Inc dx
Mov al,01h
Out dx,al
;-----------------------------------------------------------
Dec dx ; Enable watchdog timer to be reset by mouse
Mov al,0f7h
Out dx,al
Inc dx
In al,dx
Or al,80h
Out dx,al
;-----------------------------------------------------------
Dec dx ; lock W83627HF
Mov al,0aah
Out dx,al

Example4. Enable watchdog timer to be reset by keyboard


;-----------------------------------------------------------

9 Appendix A
Mov dx,2eh ; unlock W83627H
Mov al,87h
Out dx,al
Out dx,al
;-----------------------------------------------------------
Mov al,07h ; Select registers of watchdog timer
Out dx,al
Inc dx
Mov al,08h
Out dx,al
;-----------------------------------------------------------
Dec dx ; Enable the function of watchdog timer
Mov al,30h
Out dx,al
Inc dx
Mov al,01h
Out dx,al
;-----------------------------------------------------------
Dec dx ; Enable watchdog timer to be strobed reset by
keyboard
Mov al,0f7h
Out dx,al
Inc dx
In al,dx
Or al,40h
Out dx,al
;-----------------------------------------------------------
Dec dx ; lock W83627HF
Mov al,0aah
Out dx,al

Winbond 83627EHG-A Watchdog User’s Guide


Example5. Generate a time-out signal without timer counting
;-----------------------------------------------------------
Mov dx,2eh ; unlock W83627H
Mov al,87h
Out dx,al
Out dx,al
;-----------------------------------------------------------
Mov al,07h ; Select registers of watchdog timer
Out dx,al
Inc dx
Mov al,08h
Out dx,al
;-----------------------------------------------------------
Dec dx ; Enable the function of watchdog timer
Mov al,30h
Out dx,al
Inc dx
Mov al,01h
Out dx,al
;-----------------------------------------------------------
Dec dx ; Generate a time-out signal
Mov al,0f7h
Out dx,al ;Write 1 to bit 5 of F7 register
Inc dx
In al,dx
Or al,20h
Out dx,al
;-----------------------------------------------------------
Dec dx ; lock W83627HF
Mov al,0aah

11 Appendix A
Out dx,al

A.1.4 Watchdog Memo


There is no reset/interrupt selection on this hardware design. The
example code in this document uses the internal path for Time out event
which is KBRST#. This internal signal in the Winbond 83627EHG-A
will reset the system when watchdog timeout event happen. These
sample code is also workable for some for motherboard which has
“Reset/Interrupt” Selection. But the example code in the motherboard
which has “Rset/Interrupt” Selection may not workable on this
motherboard.

Winbond 83627EHG-A Watchdog User’s Guide

You might also like