Reading Voltages - Lippert Cool SpaceRunner LX800 Technical Manual

Pc/104-plus cpu board
Table of Contents

Advertisement

Reading Voltages

The +12/-12V supplies are not used by any on board components, but only forwarded to the PC/104+ and
backlight connectors. Still, the voltages on these lines can be monitored in the BIOS Setup (see above) or by an
application, as shown here.
#include <stdio.h>
#include <sys/io.h> // needed for inb/outb
#define EC_INDEX 0x295
#define EC_DATA 0x296
int main()
{
signed int p12V, n12V;
if (iopl(3)) { // Linux-specific, e.g. DOS doesn't need this
printf("Failed to get I/O access permissions.\n");
printf("You must be root to run this.\n");
return 1;
}
outb(0x24, EC_INDEX); // read +12 V voltage
p12V = ((unsigned char)inb(EC_DATA)) * 64; //mV
printf("+12 V voltage: %+5.1f V\n", p12V/1000.0);
outb(0x25, EC_INDEX); // read -12 V voltage
n12V = ((unsigned char)inb(EC_DATA)) * 80 - 16384; //mV
printf("-12 V voltage: %+5.1f V\n", n12V/1000.0);
return 0;
}
TME-104P-CSR-LX800-R1V11.doc
Rev 1.11
46 (50)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents