Lanner LEC-7900 User Manual Page 27

  • Download
  • Add to my manuals
  • Print
  • Page
    / 36
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 26
26
Appendix A. Watchdog Timer
Introduction
Most systems need to be self-reliant. If an error should occur it is typically not possible to
wait for the system to be rebooted manually. In some cases, such as apace probes, the system
is simply disabled. In other cases, the speed at which a human operator would reset the
system would be too slow to meet the uptime requirements of the product.
A watchdog timer is a piece of hardware that can be used to automatically detect system
anomalies and reset the processor if the case any problems are found. Generally speaking, a
watchdog timer is based on a counter that counts down from an initial value to zero. The
software selects the counter's initial value and periodically restarts it. Should the counter
reach zero before the software restarts it, the software is presumed to be malfunctioning and
the processor's reset signal is asserted. Thus, the processor will be restarted as if a human
operator had cycled the power
Watch Dog Sample code:
// Copyright (c) 2008 Lanner Electronic Inc. All rights reserved.
// Watchdog control utility for LEB-7900
#include <stdio.h>
#include <string.h>
#include <dos.h>
#include <stdlib.h>
#include <inlines/pc.h>
#define INDEX_PORT 0x2e
#define DATA_PORT 0x2f
#define CR20_REG 0x20 //This register indicate the device's ID
#define W83627UHG_ID 0xA2
void help()
{
printf("Lanner Electronics Inc. 2009-05-22\n");
printf("Watchdog timer control V1.0 for LEB-7900\n\n");
printf("wdbp.exe -wr xxx (1-255 sec)(Watchdog Control - SYSTEM RESET)\n");
printf("\n");
}
int main(int argc, char *argv[])
{
int temp9 = 0;
int time;
if( argc < 2 )
{
help();
return -1;
}
//;********** Detect SIO ******************
Enter_Configuation();
if(detect_sio())
{
printf("It's not correct SuperIO, program terminated!!!\n");
temp9 = read_w83627UHG_reg(0, CR20_REG);
printf("Rx20 = %02X\n", temp9);
return -1;
}
Exit_Configuation();
Init_WDTO_GPIO_Interface();
//;********************* Setting Watchdog timer for System Reset
Page view 26
1 2 ... 22 23 24 25 26 27 28 29 30 31 32 ... 35 36

Comments to this Manuals

No comments