From: Dave H. <dhy...@gm...> - 2009-04-28 20:50:35
|
Hi Ben, On Tue, Apr 28, 2009 at 12:54 PM, artec <art...@ya...> wrote: > >>I'm assuming that you've connected up SDA, SCL, and GND to the GPIO14 >>device, and that you've added pullup resistors on SCL and SDA. > > Ok, so the address is either 0x20 or 0x40. I am using 4.7K resistors on SCL > and SDA. The resistors are on the gumstix side of the level shifter, so the > path is as follows: gumstix_SCL-->resistor-->level_shifter-->GPIO14_SCL > > Do I need a resistor on both sides? Here is the level shifter I am using: > http://www.sparkfun.com/commerce/product_info.php?products_id=8745 Hmmm. That level shifter is intended for unidirectional translation (like serial) and not for bidirectional signals (like those used in i2c). Now, if you compare it to this one: <http://www.headfuzz.co.uk/files/robotics/i2c/i2ctranslator-sch.png> you can see that the TX portion of the sparkfun one is really the same as the bidirectional one. So if you used both TX units on the SParkfun converter then you should be good to go. The Sparkfun one appears to include pullups on both sides. > I have SCL and SDA each on a Tx (bidirectional) pin, and I am not using Rx. I guess I should have read the whole email :) > What should the voltages of SCL and SDA be? SDA seems to always be ~3.3V. > When idle, SCL is ~0V on the gumstix, but ~2.2V on the level shifter. Is > this a problem? However, when I issue an i2c command, SCL goes to 3.3V on > gumstix side. When idle SCL and SDA should both be idling in a logic high state (so 3.3v on the gumstix side). > I thought maybe something was wrong with the GPIO14, so I hooked up an i2c > clock: http://www.sparkfun.com/commerce/product_info.php?products_id=99 > and tried: i2c 0x68 rb 0x02, I also tried address 0x34 just in case. I > still get the same error (121). Any suggestions? Do I need to initialize > i2c or something? The i2c modules need to be loaded (lsmod should show i2c-dev and i2c-pxa (at least for the verdex)). With the verdex you can configure the pins as gpio pins, and you should be able to manually toggle the pins between high and low voltages and observe the changes on the physical pins. If SCL is stuck low, then that would definitely be a problem. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ |