[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howtos:hardware:arm:interfacing_i2c_devices [2023/05/28 13:16 (UTC)] – [Voltage Level Shifting] louigi600howtos:hardware:arm:interfacing_i2c_devices [2023/05/28 14:46 (UTC)] (current) – [Hacking I2C in PC DIMM modules] louigi600
Line 6: Line 6:
 ====== Preface ====== ====== Preface ======
 Most modern PC have several internal components that communicate vital information, like internal temperatures of critical components, over I2C bus. This type of stuff is factory wired into your PC and is normally dealt with lm_senosrs ... what we want to do here is use an I2C bus on your computer to connect some external I2C sensor like an accelerometer. I'm tagging this in the ARM hardware section because I think that, excluding the lm-sensors stuff, most people will be doing this sort of thing on embedded ARM systems ... but the concepts are applicable to any linux capable system with an I2C bus. Most modern PC have several internal components that communicate vital information, like internal temperatures of critical components, over I2C bus. This type of stuff is factory wired into your PC and is normally dealt with lm_senosrs ... what we want to do here is use an I2C bus on your computer to connect some external I2C sensor like an accelerometer. I'm tagging this in the ARM hardware section because I think that, excluding the lm-sensors stuff, most people will be doing this sort of thing on embedded ARM systems ... but the concepts are applicable to any linux capable system with an I2C bus.
-Should you want to hack one of the many I2C busses on your PC the easiest one to access is the one in the DIMM modules. Modern DIMM modules have an I2C eprom in them that the bios reads to find out the characteristics of the DIMM module. Since the DIMM module can be removed from PC and hacked separately without risking to damage permanently your PC it is probably your safest option.+ 
 +Should you want to hack one of the many I2C busses on your PC the easiest one to access is the one in the DIMM modules. Modern DIMM modules have an I2C eprom in them that the bios reads to find out the characteristics of the DIMM module. Since the DIMM module can be removed from PC and hacked separately without risking to damage permanently your PC it is probably your safest option. See chapter "Hacking I2C in PC DIMM modules" for more details.
  
  
Line 263: Line 264:
  
  
-====== Hacking I2C in DIMM modules ====== +====== Hacking I2C in PC DIMM modules ====== 
-A+As mentioned in the Preface it is possible to hack, in fact, any one of the I2C busses on your PC it's just that the one in DIMM modules it the easiest one. 
 +You will need to identify these 4 connections on your DIMM module's eprom that respectively go to these pins on the DIMM module itself: 
 + 
 +200 pin SO-DIMM 1/2: 
 +^ Pin ^ Function  ^  
 +| 197 | Vcc (3v)  | 
 +| 193 | SDA       | 
 +| 195 | SCL       | 
 +| 185 | GND       | 
 + 
 +204 pin SO-DIMM 3:  
 +^ Pin   ^ Function  ^  
 +| 199     | Vcc (3v)| 
 +| 200     | SDA     | 
 +| 202     | SCL     | 
 +| 203/204 | GND     | 
 + 
 +260 pin SO-DIMM 4: 
 +^ Pin     ^ Function  ^  
 +| 255     | Vcc (2.5v)| 
 +| 254     | SDA       | 
 +| 253     | SCL       | 
 +| 251/252 | GND       | 
 + 
 +Once you have identified them you can stack up another I2C device on the bus provided it will not conflict with the addresses in use on this bus. 
 + 
 +I have an old laptop with a 4Gb SO-DIMM 3 that is perfect for experimenting. 
 +The DIMM has onboard a ST M34: a I2C bus Serial EEPROM, SPD for DRAM. I downloaded the datasheet and found that on the eprom itself 
 +^ Pin ^ Function ^  
 +| 8   | Vcc (3v) | 
 +| 5   | SDA      | 
 +| 6   | SCL      | 
 +| 4   | GND      | 
 + 
 +and I double-checked that these pins are actually connected to the respective pins on the SO-DIMM module. 
 +I was particularly lucky and this module has unused solder pads for a second eprom unit, making it super easy to solder some wires on the unused pats to hack another I2C device into the bus. 
 + 
 +Next you will need to identify which bus is the one reading the eprom on the DIMM modules, there is another tool that is part of the i2ctool that comes in handy for this: decode-dimms. 
 +At the beginning it will sit out a line like this 
 + 
 +Decoding EEPROM: /sys/bus/i2c/drivers/ee1004/0-0050 
 + 
 +The last part 0-0050 identifies bus 0 address 50.  
 + 
 +Looking at what devices are present on bus 0 
 + 
 +  # i2cdetect -y 0 
 +        1  2  3  4  5  6  7  8  9  a  b  c  d  e  f 
 +  00:                         08 -- -- -- -- -- -- --  
 +  10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  
 +  20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  
 +  30: 30 -- -- -- -- 35 UU UU -- -- -- -- -- -- -- --  
 +  40: -- -- -- -- 44 -- -- -- -- -- -- -- -- -- -- --  
 +  50: UU -- 52 -- -- -- -- -- -- -- -- -- -- -- -- --  
 +  60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  
 +  70: -- -- -- -- -- -- -- -- 
 + 
 +So as long as whatever device I hack into this bus does not use address 8,30,35,36,37,44,50 or 52 it should work fine, provided the voltages are compatible. 
 + 
 + 
 ====== Sources ====== ====== Sources ======
 <!-- If you are copying information from another source, then specify that source --> <!-- If you are copying information from another source, then specify that source -->
 howtos:hardware:arm:interfacing_i2c_devices ()