I2C Not Working
LowIQGenius
Posts: 13
Hello all,
I'm trying to learn I2C communications on the propeller, but am having trouble getting it to work. I've loaded the EEPROM test code from the Learn folder (as described here: http://learn.parallax.com/propeller-c-simple-protocols/eeprom-test-code), but it reports "testStr = " without the "abcdef" part. I am using the Propeller Education Kit. Can anyone explain what may be going wrong? Thanks in advance!
I'm trying to learn I2C communications on the propeller, but am having trouble getting it to work. I've loaded the EEPROM test code from the Learn folder (as described here: http://learn.parallax.com/propeller-c-simple-protocols/eeprom-test-code), but it reports "testStr = " without the "abcdef" part. I am using the Propeller Education Kit. Can anyone explain what may be going wrong? Thanks in advance!
Comments
Ray
Not sure what part I was unclear about... The code is found in the link, but here it is anyway:
And a perfect graphical representation of the wiring is given here:
I do only have the 32kb ic, but changing the starting address to one within range of my smaller EEPROM didn't help. After looking more at the tutorial, I'm thinking the problem may be that the code provided requires pullup resistors on the i2c lines... Do you happen to know if the primary (program memory) EEPROM uses the propeller's internal pullups by default?
Per the schematic on page 27 of the PEK manual, you should have a 10K resistor from SDA to 3.3V bus. Without this pullup, I2C more often than not, will not work. I would also suggest putting a 10K pullup on the SCL line.
You should put pullups on the I2C lines. The Propeller has no internal pullups. All of the current boards (including Dave's QuickStart) have pullups. There were some early boards that I believe did not have pullups and also, the PEK doesn't specify pullups. I recall reading somewhere that the Propeller itself has no issue using the EEPROM for loading/booting without pullups but beyond those uses, it should have pullups. Worth a try - surely won't hurt anything.
There is no way for it to "protect" the lower 32K from your program, so you can easily blow your toes off if you decide to write to the lower 32k and not knowing exactly what you are writing to. (Don't worry too much, F11 will give you your toes back!)
The library allows for either driving the clock or pulling it down (pull up on SCL).