title: Can you piece together the following clues to help me read temperatures out of the Winbond W83793 chip?
body: <p>I am trying to get <a href="http://openhardwaremonitor.org/" rel="nofollow">OpenHardwareMonitor</a> to read temperature data out of the <a href="http://www.nuvoton-usa.com/products/winbond_products/pdfs/PCIC/W83793Ga.pdf" rel="nofollow">Winbond W83793 chip</a> on my Supermicro X7DWA motherboard.  The problem is that I don't have any low-level programming experience, and the available docs online do not seem to be sufficient in explaining how to access the temperatures.  </p>
  
  <p>However, over the month that I've been working on this problem, I have discovered a few values and low-level methods that may be the key to solving my problem.  I just need to figure out how to use them to get what I want.  That's where I turn to you, because you might understand what this information means, and how to apply it, unlike me.  I've already done my fair share of poking around, resulting in many blue screens and computer restarts.  Enough guessing, I need to piece these clues together.  Here is what I know so far:</p>
  
  <ol>
  <li><p>To read from the chip, I will somehow need to access the SMBus, because that is the way monitoring programs, such as CPUID HWMonitor, are getting the information.  OpenHardwareMonitor, as far as I know, does not have any code in it to access the SMBus, which is why it may not be reading from the chip.  However, OpenHardwareMonitor has the following methods included in its <a href="http://code.google.com/p/open-hardware-monitor/source/browse/trunk/Hardware/Ring0.cs" rel="nofollow">Ring0 class</a>, which it uses to access information from other chips.  I may be able to use these methods to my advantage:</p>
  
  <pre><code>void Ring0.WriteIOPort(uint port, byte value);
  byte Ring0.ReadIOPort(uint port);
  </code></pre></li>
  <li><p>Among other information, HWMonitor reports the following information about the Winbond W83793 chip to me when I save a report:</p>
  
  <blockquote>
    <p>Register Space:     SMBus, base address = 0x01100</p>
    
    <p>SMBus request:      channel 0x0, address 0x2F</p>
  </blockquote>
  
  <p>It looks like these are important values, but I don't know exactly what they mean, and how I can use them in conjunction with the Ring0 methods above.  Hmm... so many clues.  The other values HWMonitor shows me are the actual voltages, temperatures, and fan speeds, and an array of hexadecimal values that represents data from somewhere on the chip, which I will reproduce here if you want to look at it.</p></li>
  <li><p>Finally, in the W83793 data sheet, on page 53 (if you have the document open), here are the addresses in hex of the temperatures I would like to read (I believe):</p>
  
  <blockquote>
    <p>TD1 Readout     - Bank 0 Address 1C</p>
    
    <p>TD2 Readout     - Bank 0 Address 1D</p>
    
    <p>TD3 Readout     - Bank 0 Address 1E</p>
    
    <p>TD4 Readout     - Bank 0 Address 1F</p>
    
    <p>Low bit Readout - Bank 0 Address 22</p>
    
    <p>TR1 Readout     - Bank 0 Address 20</p>
    
    <p>TR2 Readout     - Bank 0 Address 21</p>
  </blockquote></li>
  </ol>
  
  <p>That is all I know so far.  The OpenHardwareMonitor, W83793 chip, and Ring0 code are available via the links provided above. As I said earlier, I've been at it for a month, and I just haven't been able to solve this mystery yet.  I hope you can help me.  All this information may seem a bit intimidating, but I'm sure it will make sense to someone with some low-level programming experience.</p>
  
  <p>To summarize my question, use the clues provided above to figure out how to get OpenHardwareMonitor to read temperatures out of the W83793 chip.  I don't need details on creating a chip in OpenHardwareMonitor.  I already have a class ready.  I just need the sequence and format to write Ring0 commands in, if that's what I need to do.</p>
  
  <p>EDIT: I found some more information.  I printed an SMBus device report from HWMonitor, and among other things, I got this line, included here because it says 0x2F:</p>
  
  <blockquote>
    <p>SMB device: I/O = 0x1100, address 0x2F, channel = 0</p>
  </blockquote>
  
  <p>This must mean I need to somehow combine the addresses of the I/O with the address of the chip, which seems to be 0x2F.  I tried adding them together but then I get all temperature readings to be 255, so that wasn't the right guess.</p>