Fan/Tachometer Monitor; Fan Tachometer Read Code Example - VersaLogic Komodo VL-EPICs-36 Reference Manual

Table of Contents

Advertisement

Fan/Tachometer Monitor

The Super I/O chip on the VL-EPICs-36 contains a hardware monitor which includes a 16-bit fan
tachometer register that can be read to obtain the speed of the fan on the VL-EPICs-36. When
one byte of the 16-bit register is read, the other byte latches the current value until it is read, in
order to ensure a valid reading. The order is LSB first, MSB second. The value FFFFh indicates
that the fan is not spinning. For more information see the
Datasheet.
F
T
AN
ACHOMETER
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <graph.h>
#include <dos.h>
//Definitions
#define TRUE
#define FALSE
#define ESC
#define SIOINDEX
#define SIODATA
#define FANTACHREG
#define RLSREG
#define RTOFFSET
#define START
void
main
()
{
int
baseIOHigh;
int
baseIOLow;
int
FTraw;
int
Bindex;
int
Bdata;
double
fanRPM;
char
keypressed
= 0;
_clearscreen(
_GCLEARSCREEN
_settextposition(2,1);
printf(
"FANTACH DEMO...(press ESC to quit).\n"
/*
Set SIO Hardware Monitor IRQ and read in the HWM base address...
outp( SIOINDEX,
0x55
outp( SIOINDEX,
0x07
outp( SIODATA,
0x0A
outp( SIOINDEX,
0x60
baseIOHigh
= inp(
outp( SIOINDEX,
0x61
baseIOLow
= inp(
SIODATA
outp( SIOINDEX,
0xAA
Bindex
=
(baseIOHigh
Bdata
=
Bindex
+ 1;
/*
Start Hardware Monitoring...
outp( Bindex,
RLSREG
outp( Bdata, inp(
VL-EPICs-36 Reference Manual
R
C
E
EAD
ODE
XAMPLE
1
0
27
0x2E
0x2F
0x28
0x40
0X70
0x01
);
);
);
);
);
SIODATA
);
);
) + RTOFFSET;
);
<< 8) + baseIOLow;
);
Bdata
) |
START
);
SMSC SCH3114 Super I/O Chip
);
//Enter SIO config mode.
//Point to Logical Device Config reg.
//Select SMSC Runtime reg.
//Index High Byte of Runtime reg base address.
//Read High Byte.
//Index Low Byte of Runtime reg base address.
//Read Low Byte and add offset to runtime reg base.
//Exit SIO Config mode
//convert high and low bytes to 16-bit address.
//Index Ready, Lock, Start Reg.
//Set bit 0 to start.
System Features
*/
*/
24

Advertisement

Table of Contents
loading

Table of Contents