Changes between Version 2 and Version 3 of VoltageLabelsAndScaling

Show
Ignore:
Timestamp:
03/01/12 14:34:21 (15 months ago)
Author:
khali
Comment:

Add subsections to make article easier to read

Legend:

Unmodified
Added
Removed
Modified
  • VoltageLabelsAndScaling

    v2 v3  
    11= How to figure out the voltage labels and scaling factors = 
     2 
     3== Problem == 
    24 
    35Voltages are the most difficult part to configure. While temperature and fan speed values are generally reported correctly by the drivers directly, voltages are not. 
     
    911 
    1012The scaling resistors can either be internal to the chip (the chip has dedicated pins for all voltages beyond its ADC range) or external (resistors are soldered on the motherboard.) Internal scaling is easy to deal with and the driver will do it for you. External scaling is motherboard specific and cannot be done by the driver. It has to be done in the libsensors configuration file specifically for every motherboard. Unfortunately the vendors rarely provide enough information to write such configuration statements, so some experimental work is needed. This guide will guide you through this. 
     13 
     14== Reference values == 
    1115 
    1216First of all, we need reference values to know which result we are supposed to get to. In most cases, the reference will be the BIOS, which typically displays all monitored values. So, boot your machine and go to the BIOS, and write down on a sheet of paper the label and value for every voltage being monitored. If you can spot more than one value per item, this is very useful, so write down all values. The reference can also be a piece of software provided by the vendor. 
     
    2226For other chips, try to find the answer in the datasheet, driver documentation or source code. 
    2327 
    24 Then we can start comparing the values reported by the BIOS with the values reported by {{{sensors}}}. I will use the Asus E35M1-I Deluxe motherboard as an example. This board uses an ITE IT8771 chip for hardware monitoring. According to the table above, its ADC ranges from 0 to 3.06V with 1 bit = 12 mV. 
     28Then we can start comparing the values reported by the BIOS with the values reported by {{{sensors}}}. 
     29 
     30== An example == 
     31 
     32I will use the Asus E35M1-I Deluxe motherboard as an example. This board uses an ITE IT8771 chip for hardware monitoring. According to the table above, its ADC ranges from 0 to 3.06V with 1 bit = 12 mV. 
    2533 
    2634The BIOS reports the following voltage values: 
     
    4957Here we are lucky that some of the inputs have internal mapping and scaling so the driver already applied proper scaling and labels to them. In particular the +3.3V line is already OK. 3VSB and Vbat are also OK, so we get them for free even though the BIOS doesn't even list them. This leaves us with 3 voltage values to map and optionally scale: CPU, 5V and 12V. 
    5058 
     59== Solving unscaled inputs == 
     60 
    5161We'll start with CPU as it is the easiest one. Voltage of modern processors is relatively low, always inside the ADC range so scaling isn't needed. So we are looking for an input with value 1.368. {{{in0}}} is a very obvious candidate. Note that we are again lucky here because most modern processors can operate at different voltages depending on the frequency, so the value from {{{sensors}}} doesn't necessarily match what the BIOS shows. Frequency scaling is usually not in effect under the BIOS setup screen so you should either temporarily disable it under Linux as well or put heavy load on the CPU while trying to do the input match. On the plus side, note that the CPU voltage (Vcore) is almost always connected to {{{in0}}} so it's a safe bet if there's nothing contradicting this hypothesis. 
     62 
     63The same would work with other low voltage values such as AGP voltage, DDR2 or DDR3 SDRAM voltage, VIO or Vtt, as they do not require scaling resistors. 
     64 
     65== Solving scaled inputs == 
    5266 
    5367For 5V and 12V, things are a little harder. Both values are above the ADC's range (3.06 V) so we aren't looking only for mappings but also for scaling factors. Unfortunately it's not possible to find the mappings if you don't know the scaling factors (comparing the scaled values from the BIOS with the unscaled values from {{{sensors}}} doesn't work), and it would seem impossible to guess the scaling factors if you don't know the mapping. Looks like a dead end to you? Not really. All this means is that we have to be smart. 
     
    6175 
    6276Here again we are somewhat lucky, hunt was good and we have 4 sample values for each input. Each of the values above corresponds to an 8-bit register value, which is multiplied by 12 mV and then by the scaling factor for the respective input. As registers can only hold integer values, we know that the values listed above are separated by an integer number of 12 mV * scaling factor steps, and the integer numbers in question will always be small (typically 1, 2 or 3.) From this we should be able to guess the scaling factor. 
     77 
     78=== Solving 12V === 
    6379 
    6480Let's start with 12V. The differences between the 4 values are as follows: 
     
    7692}}} 
    7793which is close enough to {{{in2}}} (2.90 V). If it had not worked, we would have tried again with the assumption that 2 LSB of the ADC corresponds to 50 mV after scaling. Then 3 LSB, etc until the candidate scaling factor is below 1, which never happens. 
     94 
     95=== Solving 5V === 
    7896 
    7997And now we do the same for 5V: 
     
    96114}}} 
    97115which is close enough to {{{in5}}} (2.93 V).  
     116 
     117== Writing the configuration file == 
    98118 
    99119Finally we can write the partial configuration file which corresponds to our findings: