beautypg.com

Ar-b8601 user manual – Acrosser AR-N8601 User Manual

Page 18

background image

AR-B8601 User Manual

18


BYTE Format=0x01; // Default is 0x01 = Seconds

if ( argc != 3 )

{ Show_Title(); return 1; }

clrscr();

textcolor(YELLOW+BLINK);

Time=atoi(argv[1]);

Time_Format=argv[2][0];

if(Time_Format=='m' || Time_Format=='M')

Format=0x05;

//

Minutes

if(Time_Format=='s' || Time_Format=='S')

Format=0x01;

//

Seconds

// Set Watchdog

outportb(IO_Port_Address,0x87); // (EFER) Extended Functions Enable Register

outportb(IO_Port_Address,0x87);

outportb(IO_Port_Address,0x29); // Point to Global Reg.

outportb(IO_Port_Address+1,0x20);

// Select Multi-Function pin, (Bit[5,6]=01 Watchdog Function)

outportb(IO_Port_Address,0x07); // Point to Logical Device Number Reg.

outportb(IO_Port_Address+1,0x08);

// Select logical device 8, (Watchdog Function)

outportb(IO_Port_Address,0x30); // Device Active register

outportb(IO_Port_Address+1,0x01);

outportb(IO_Port_Address,0xF3); // Select Watchdog count mode seconds or minutes

outportb(IO_Port_Address+1,Format); // Default is second

outportb(IO_Port_Address,0xF4); // Set Watchdog Timer Value

outportb(IO_Port_Address+1,Time);

// 0x00 to disable, max 0xFF

while(1)

{