TME-EPIC-HURLX-R3V5.docx
Rev 3.5
Page 44 of 49
4.4
Handling Of Analog Inputs
To activate all analog inputs of the Hurricane-LX800, reset the Super I/Os Extended 2 Multifunction Pin selection
register 2Ch, bits 0 and 1 only. The register is located in Logical Device 07h.
The values can be read back using index/data port 295h/296h of the LPC Bus. The registers are located at
addresses 20h...27h (SIO_ADC0...SIO_ADC7).
Enable scan of these pins by writing FFh to register 50h of the LPC Bus.
The conversion rate can be configured with Logical Device 4, Register F4h. Bits 7 and 6 set the conversion rate. It
is set to one second per default.
Bit7 Bit6
Frequency [Hz]
0
0
1
0
1
2
1
0
4
1
1
8
4.5
Temperature readout
Since it is possible to readout the CPU and the ambient temperature, the following code in C shows how to do
that. The example is meant to be compiled using gcc under Linux.
#include <stdio.h> //include header files
#include <sys/io.h>
#include <unistd.h>
int main() //main function
{
char t1hex = 0x0;
char t2hex = 0x0;
iopl(3);
//*** needed by BIOSes prior to version 7 ***
outb(0x51,LPC_INDEX); //thermal diode mode
outb(0x03,LPC_DATA);
outb(0x5C,LPC_INDEX); //unlock offset regs
outb(0x80,LPC_DATA);
outb(0x56,LPC_INDEX); //offset adjustment CPU
outb(0x70,LPC_DATA);
outb(0x57,LPC_INDEX); //offset adjustment Ambient
outb(0x3C,LPC_DATA);
outb(0x5C,LPC_INDEX); //lock offset regs
outb(0x00,LPC_DATA);
//******************************************
printf("CPU AMBIENT\n"); //return message
while(1)
{
outb(0x29,0x295); //read out CPU temp
t1hex = inb(0x296);
outb(0x2A,0x295); //read out Ambient temp
t2hex = inb(0x296);
printf("%3d %3d\r", t1hex, t2hex); //printout to the screen
fflush(stdout);
sleep(1);
}
return 0;
}