A.1 About Watchdog Timer
After the system stops working for a while, it can be auto-reset by the watchdog timer. The
integrated watchdog timer can be set up in the system reset mode by program.
A.2 How to Use Watchdog Timer
/////////////////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <dos.h>
#define AXIOM_WDT_TIMER
#define AXIOM_WDT_TRIGGER
void main()
{
unsigned long int DefaultTimer = 0xFFFF; // 65535 Seconds
unsigned long int CurrentWdtTimer = 0;
clrscr();
// Set WDT Timer, maximum is 65535 seconds
outportw(AXIOM_WDT_TIMER, DefaultTimer);
printf("Set WDT Timer to: %ld Seconds\n", DefaultTimer);
// 0x01: Enabled WDT, 0x00: Disabled WDT
outportb(AXIOM_WDT_TRIGGER, 0x01);
printf("Enabled WDT Timer\n");
while(1)
{
clrscr();
// Get current WDT Timer
CurrentWdtTimer = inportw(AXIOM_WDT_TIMER);
printf("Set WDT Timer to: %ld Seconds\n", DefaultTimer);
printf("Current WDT Timer: %ld Seconds\n", CurrentWdtTimer);
delay(1000);
}
}
/////////////////////////////////////////////////////////////////////////////////////////
Watchdog Timer
CEM521 COM Express
Watchdog Timer
0xFA10
0xFA12
TM
Type 6 Module
Appendix A
55
Need help?
Do you have a question about the CEM521 and is the answer not in the manual?
Questions and answers