Acrosser AR-ES6050FLD User Manual

Page 36

Advertising
background image

Revision: 1.0

36

The WATCHDOG sample code of C language as below:

//====================================================================
=======
// Rev Date

Name Description

//====================================================================
=======
// 1.0

12/16/2009 Willy

W83627EHF WatchDog timer test

//====================================================================
=======

//====================================================================
=======
// Language include files
//====================================================================
=======
#include <conio.h>
#include <stdlib.h>
#include <stdio.h>
#include <dos.h>

//====================================================================
=======
// Normal procedure
//====================================================================
=======
void Show_Help();

//====================================================================
=======
// Main procedure
//====================================================================
=======
int main(int argc, char *argv[])
{
unsigned char IO_Port_Address=0x2E;
unsigned char Time;

unsigned char Temp;

if ( argc != 2 )
{ Show_Help(); return 1; }

clrscr();

Time=atoi(argv[1]);

// Set Watchdog
outportb(IO_Port_Address,0x87);

// (EFER) Extended Functions Enable Register

outportb(IO_Port_Address,0x87);

Advertising