
AEWIN Technologies Co., Ltd MB-8390 User Manual
65
4.2 Watchdog timer Sample Program for DOS environment
//AEWIN Watch dog program for MB-8390(Dos Version)
#include <stdio.h>
#include <string.h>
#include <dos.h>
#include <stdlib.h>
#include <inlines/pc.h>
#define index_port 0x4E
//Super IO Index port address
#define data_port 0x4F
//Super IO Data port address
void Enter_sio_config();
void Exit_sio_config();
void help();
int main(int argc, char *argv[])
{
int data_rw8, time;
if (argc<2){
help();
return;
}
if(strcmp(argv[1], "-s") == 0){
//Show Watchdog Register Settings
Enter_sio_config();
outportb(index_port, 0xF5);
data_rw8 = inportb(data_port)&0x08;
if(data_rw8 == 0x00){
//second mode
outportb(index_port, 0xF6);
data_rw8 = inportb(data_port);
printf("Second mode: %d second\n", data_rw8);
}