User`s manual

- 62 -
Appendix
Appendix A: Watchdog Timer (WDT) Setting
WDT is widely applied to industry computers to monitor activities of CPU. The
programmed application triggers WDT with adequate timer setting depending
on its requirement. Before WDT counts down to zero, the functional system
will reset the counter. In case the WDT counter is not reset by an abnormal
system, it will counts down to zero and then reset the system automatically.
This computer supports the watchdog timer up to 255 levels for users for
software programming. Below please take the source code written in C for a
WDT application example.
/*----- Include Header Area -----*/
#include “math.h”
#include “stdio.h”
#include “dos.h”
#dene SIO_INDEX 0x2E /* or index = 0x4E */
#dene SIO_DATA 0x2F /* or data = 0x4F */
/*----- routing, sub-routing -----*/
void main()
{
outportb(SIO_INDEX, 0x87); /* SIO - Enable */
outportb(SIO_INDEX, 0x87);
outportb(SIO_INDEX, 0x07); /* LDN - WDT */
outportb(SIO_DATA, 0x07);
outportb(SIO_INDEX, 0x30); /* WDT - Enable */
outportb(SIO_DATA, 0x01);
outportb(SIO_INDEX, 0xF0); /* WDOUT - Enable */
outportb(SIO_DATA, 0x80);
outportb(SIO_INDEX, 0xF5); /* WDT - Conguration */
outportb(SIO_DATA, 0x72);
outportb(SIO_INDEX, 0xF6); /* WDT - Timeout Value : 5sec */
outportb(SIO_DATA, 0x05);
outportb(SIO_INDEX, 0xAA); /* SIO - Disable */
}