Wdt1 dos example – AAEON PFM-535S User Manual

Page 40

Advertising
background image

P C / 1 0 4 C P U M o d u l e

P F M - 5 3 5 S

Appendix A Programming the Watchdog Timer A-7

WDT1 DOS Example

#include <stdio.h>

#include <conio.h>

void main()

{

unsigned char c;

unsigned long lTime;

// 500 mini-second

lTime = 0x20L * 500L;

outp(0x6c, (lTime >> 16) & 0xff);

outp(0x6b, (lTime >> 8) & 0xff);

outp(0x6a, (lTime >> 0) & 0xff);

// Reset system. For example, 0x50 to trigger IRQ7

outp(0x69, 0xd0);

// Enable watchdog timer

c = inp(0x68);

c |= 0x40;

outp(0x68, c);

printf("Press any key to stop trigger timer.\n");

while(!kbhit())

outp(0x67, 0x00);

printf("System will reboot after 500 milli-seconds.\n");

}

Advertising