Acrosser AR-B5890 Manuel d'utilisateur Page 19

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 33
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 18
AR-B5890 User Manual
19
WATCHDOG TIMER
//===========================================================================
// Turbo C++ Version 3.0 Copyright(c) 1990, 1992 by Borland International,Inc.
//===========================================================================
// Describe : ITE8718F WatchDog timer test
// Date : 12/16/2009
// Author : Willy
//===========================================================================
#include <conio.h>
#include <stdlib.h>
#include <stdio.h>
#include <dos.h>
//===========================================================================
// Main procedure
//===========================================================================
int main(int argc, char *argv[])
{
unsigned char IO_Port_Address=0x2E;
unsigned char Time;
unsigned int Temp;
long int Time1 = 0, C = 0;
if ( argc != 2 )
{ Show_Help(); return 1; }
clrscr();
Time=atoi(argv[1]);
// Set Watchdog
outportb(IO_Port_Address,0x87); // Enter configure
outportb(IO_Port_Address,0x01);
outportb(IO_Port_Address,0x55);
outportb(IO_Port_Address,0x55);
outportb(IO_Port_Address,0x07); // Point to Logical Device Number Reg.
outportb(IO_Port_Address+1,0x07); // Select logical device 7, (Watchdog Function)
outportb(IO_Port_Address,0x23); // Select Watchdog use CLKIN
outportb(IO_Port_Address+1,inportb(IO_Port_Address+1)|0x10);
outportb(IO_Port_Address,0x72); // Select Watchdog use keyboard reset
outportb(IO_Port_Address+1,0x40);
outportb(IO_Port_Address,0x72); // Select Watchdog count mode seconds or minutes
outportb(IO_Port_Address+1,inportb(IO_Port_Address+1)|0x80); // Set Second
if (Time != 0)
{
Time1 = Time;
C = ( Time1 * (0x64) ) / (0x6C); // Time = Time * 1.08 (offset)
Vue de la page 18
1 2 ... 14 15 16 17 18 19 20 21 22 23 24 ... 32 33

Commentaires sur ces manuels

Pas de commentaire