Difference between revisions of "I²C"

From Gumstix User Wiki
Jump to: navigation, search
Line 9: Line 9:
  
  
 +
== Connecting to the I²C bus ==
  
 
The I²C bus uses 3 signals, I2C_SDA, I2C_SCL, and GND (ground), all of which are present on the [[60pin connector|60-pin Hirose]], [[120pin connector|120-pin MOLEX]] (Verdex only) and [[24pin connector|24-pin flex ribbon]] (Verdex only) connectors. Some daughter cards allow the I²C signals to be accessed directly.
 
The I²C bus uses 3 signals, I2C_SDA, I2C_SCL, and GND (ground), all of which are present on the [[60pin connector|60-pin Hirose]], [[120pin connector|120-pin MOLEX]] (Verdex only) and [[24pin connector|24-pin flex ribbon]] (Verdex only) connectors. Some daughter cards allow the I²C signals to be accessed directly.
Line 16: Line 17:
 
On the robostix board, pin 12 on the UARTS connector is SDA, and pin 16 is SCL. These are both 5v signals and have pullup resistors.
 
On the robostix board, pin 12 on the UARTS connector is SDA, and pin 16 is SCL. These are both 5v signals and have pullup resistors.
  
On the Tweener, pin 19 on the hirose connector is SDA, and pin 20 is SCL. The JTAG connector page has a photo of the hirose connector. The TDO pin shown in the photo is pin 22. The via to the left under the T is pin 21, the one under the O is pin 20, and the one under the D is 19. These are all 3.3v signals and don't have any pullup resistors.  
+
On the Tweener, pin 19 on the hirose connector is SDA, and pin 20 is SCL. The [[JTAG]] connector page has a photo of the hirose connector. The TDO pin shown in the photo is pin 22. The via to the left under the T is pin 21, the one under the O is pin 20, and the one under the D is 19. These are all 3.3v signals and don't have any pullup resistors.  
 +
 
 +
On the back of the waysmall board, amongst the set of 20 pads, the pad closest to the edge of the board and the power connector is the SDA signal, and the one next to it (also by the edge of the board) is the SCL signal. These are both 3.3v signals and don't have any pullup resistors. The waysmall board has a 3.3v regulator on it, just to the left of the power connector. It has LW33 stamped on it. The pin below the 3 (in LW33) is the 3.3v output (see the [[JTAG]] connector page which identifies the Vcc pin on the same type of regulator used on the Tweener).
 +
 
 +
 
 +
== Pullup resistors ==
 +
 
 +
The I2C bus requires pullup resistors on the SDA and SCL lines. The [http://www.semiconductors.philips.com/acrobat/literature/9398/39340011.pdf I2C specification] gives some charts for min and max values (see page 39 and 40). For a 5v or 3.3v bus, the minimum pullup resistance should be around 2k ohms. A typical value to use would be 4.7k ohms.
 +
 
 +
All of the current daughter cards (except the robostix), need to have pullup resistors added, which pullup the SDA and SCL lines to 3.3v levels.
 +
 
 +
If you use a robostix, the 3.3v pullup resistors are already included. The SDA and SCL lines on the UARTS connector are at 5v levels, and also have pullup resistors on the robostix board.
 +
 
 +
 
 +
 
 +
== Examples ==
 +
 
 +
 
 +
The [http://docwiki.gumstix.org/I2C_Max518 I2C Max518] example shows how to connect the Maxim [http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1119 MAX518], which is a dual, i2c, digital to analog converter.
 +
 
 +
The [http://docwiki.gumstix.org/I2C_DS1307 I2C DS1307] example shows how to connect the [http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2688 DS1307], which is an i2c real time clock and nvram chip.
 +
 
  
On the back of the waysmall board, amongst the set of 20 pads, the pad closest to the edge of the board and the power connector is the SDA signal, and the one next to it (also by the edge of the board) is the SCL signal. These are both 3.3v signals and don't have any pullup resistors. The waysmall board has a 3.3v regulator on it, just to the left of the power connector. It has LW33 stamped on it. The pin below the 3 (in LW33) is the 3.3v output (see the JTAG connector page which identifies the Vcc pin on the same type of regulator used on the Tweener).
 
  
  

Revision as of 08:38, 15 March 2008

I2C_SDA
I2C_SCL
GND


Connecting to the I²C bus

The I²C bus uses 3 signals, I2C_SDA, I2C_SCL, and GND (ground), all of which are present on the 60-pin Hirose, 120-pin MOLEX (Verdex only) and 24-pin flex ribbon (Verdex only) connectors. Some daughter cards allow the I²C signals to be accessed directly.

Note that some older versions of the Breakout board have pins labeled incorrectly. See the breakout page for more details.

On the robostix board, pin 12 on the UARTS connector is SDA, and pin 16 is SCL. These are both 5v signals and have pullup resistors.

On the Tweener, pin 19 on the hirose connector is SDA, and pin 20 is SCL. The JTAG connector page has a photo of the hirose connector. The TDO pin shown in the photo is pin 22. The via to the left under the T is pin 21, the one under the O is pin 20, and the one under the D is 19. These are all 3.3v signals and don't have any pullup resistors.

On the back of the waysmall board, amongst the set of 20 pads, the pad closest to the edge of the board and the power connector is the SDA signal, and the one next to it (also by the edge of the board) is the SCL signal. These are both 3.3v signals and don't have any pullup resistors. The waysmall board has a 3.3v regulator on it, just to the left of the power connector. It has LW33 stamped on it. The pin below the 3 (in LW33) is the 3.3v output (see the JTAG connector page which identifies the Vcc pin on the same type of regulator used on the Tweener).


Pullup resistors

The I2C bus requires pullup resistors on the SDA and SCL lines. The I2C specification gives some charts for min and max values (see page 39 and 40). For a 5v or 3.3v bus, the minimum pullup resistance should be around 2k ohms. A typical value to use would be 4.7k ohms.

All of the current daughter cards (except the robostix), need to have pullup resistors added, which pullup the SDA and SCL lines to 3.3v levels.

If you use a robostix, the 3.3v pullup resistors are already included. The SDA and SCL lines on the UARTS connector are at 5v levels, and also have pullup resistors on the robostix board.


Examples

The I2C Max518 example shows how to connect the Maxim MAX518, which is a dual, i2c, digital to analog converter.

The I2C DS1307 example shows how to connect the DS1307, which is an i2c real time clock and nvram chip.





.