F81801U Hardware Monitor under Windows

From LEXWiKi

Jump to: navigation, search

Contents

The Sample code source you can download from

<Google Drive>

Source file: HWMonitor_F81801U_Src_x86HWMonitor_F81801U_Src_x64

Binary file: HWMonitor_F81801U_Bin_x86 HWMonitor_F81801U_Bin_x64


<FTP>

Source file: HWMonitor_F81801U_Src_x86HWMonitor_F81801U_Src_x64

Binary file: HWMonitor_F81801U_Bin_x86HWMonitor_F81801U_Bin_x64

How to use the DEMO application

Image:f81801uhw.JPG

  1. Press the "Read Value" button , and then you can find the values in the below text boxes.

Sample code Introduction

Define Registry

#define F81801U_DEFAULT_CHIP_ID_1	0x07
#define F81801U_DEFAULT_CHIP_ID_2	0x23

#define F81801U_CHIP_ID_1			0x20
#define F81801U_CHIP_ID_2			0x21 

#define HW_MONITOR_INDEX			0x295
#define HW_MONITOR_DATA				0x296

#define CPU_FAN_MSB					0xA0
#define CPU_FAN_LSB					0xA1

#define F81801U_VOLTAGE_CORE		0x21
#define F81801U_VOLTAGE_3V			0x20
#define F81801U_VOLTAGE_VIN2		0x22
#define F81801U_VOLTAGE_VSB3V		0x27 //Modify the error in Fintek programming guide 0x25 ->0x27
#define F81801U_VOLTAGE_VBAT		0x28 //Modify the error in Fintek programming guide 0x26 ->0x28

#define F81801U_TEMPERATURE_SYSTEM	0x74
#define F81801U_TEMPERATURE_CPU		0x72

Open VT1211

SetPortVal(0x4E,0x87,1);

if ((this->F81801U_Read(F81801U_CHIP_ID_1) == F81801U_DEFAULT_CHIP_ID_1) && (this->F81801U_Read(F81801U_CHIP_ID_2) == F81801U_DEFAULT_CHIP_ID_2 ))
{
    return TRUE;		
}
else
{
    return FALSE;	
}

Read Data

DWORD dwPortVal;
SetPortVal(HW_MONITOR_INDEX, dwAddrVal,1);
GetPortVal(HW_MONITOR_DATA,&dwPortVal,1);

return ( dwPortVal & 0x00FF);

GetTemperature

switch (dwAddrVal)
{
     case F81801U_TEMPERATURE_CPU:
          return F81801U_Read(F81801U_TEMPERATURE_CPU);

     case F81801U_TEMPERATURE_SYSTEM:
          return F81801U_Read(F81801U_TEMPERATURE_SYSTEM) ;
}

GetVoltage

switch (dwAddrVal)
{
     case F81801U_VOLTAGE_CORE:
          return (float)(F81801U_Read(F81801U_VOLTAGE_CORE)*0.8)/100;

     case F81801U_VOLTAGE_3V:
          return (float)(F81801U_Read(F81801U_VOLTAGE_3V)*1.6)/100;

     case F81801U_VOLTAGE_VIN2:
          return (float)(F81801U_Read(F81801U_VOLTAGE_VIN2)*0.8)/100;

     case F81801U_VOLTAGE_VSB3V:
          return (float)((F81801U_Read(F81801U_VOLTAGE_VSB3V)*1.6)/100);

     case F81801U_VOLTAGE_VBAT:
          return (float)((F81801U_Read(F81801U_VOLTAGE_VBAT)*1.6)/100);
}
Personal tools