i2cobject
christopher
Posts: 31
Hi,
I built the 3 transistor serial programming adapter and it works successfully.
However when I run the i2cobject the 'init' function identifies the eeprom at p29 and p28 but I am not able to read from the eeprom. Also, I the test for ackbit appears to be not working. i note that the sda line is oulled up to 5v thru 4.7k. Do I need to pull up the scl line also ? Any assistance will be appreciated. The i2cobject was obtained from the parallax site by Javalin/ Jim Burrows.
Thank You
Christopher·
I built the 3 transistor serial programming adapter and it works successfully.
However when I run the i2cobject the 'init' function identifies the eeprom at p29 and p28 but I am not able to read from the eeprom. Also, I the test for ackbit appears to be not working. i note that the sda line is oulled up to 5v thru 4.7k. Do I need to pull up the scl line also ? Any assistance will be appreciated. The i2cobject was obtained from the parallax site by Javalin/ Jim Burrows.
Thank You
Christopher·
Comments
If you do add a pullup to 3.3V on the scl line (not 5V!), you can use the unmodified i2cObject.
> Do I need to pull up the scl line also ?
Yes, definitely. I2C chips relie on open collector bus signals. The Propeller uses 3.3 Volts. But I2C is specified at 5 Volts.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Vriendelijke groeten,
Jan Verhoeven
http://fruttenboel.verhoeven272.nl
WHen I made my dev system, I included the pullups (as well as 2 other chips on the same i2c lines) so I would have a complete i2c subsystem.
I'm currently using an older (from the object exchange) version of the i2c object, and it seems to work fine.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Just tossing my two bits worth into the bit bucket
KK
·
regards
Christopher
The demo board was built without a pullup on the boot eeprom clock line. This isn't a problem for the boot process since the boot routines in the Propellor ROM actively drive the clock line both HIGH and LOW. It does cause standard I2C routines to fail (unless they also drive the clock line both HIGH and LOW). I just added some code to the library i2cObject that checks for the clock pin being 28 and, if so, actively drives the clock line (rather than relying on a pullup).
Jan,
I2C chips can be specified for a variety of voltages. There are some that require 5V and others that work fine at 3.3V. Phillips has some excellent information in their I2C specification that discusses how to mix 5V and 3.3V devices in a system. Most EEPROMs work fine at 3.3V and, if you don't have a mixed system, only require a pullup to 3.3V.
Thanks for the info...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Just tossing my two bits worth into the bit bucket
KK
·
Thanks, Mike for the heads up with the dev board not having pull-ups - I have my own so didn't twig that one.
I've made a change to the i2cObject (now version 1.3) to allow you to init the object with a TRUE to pull-up and FALSE to not.
Its been posted on the object library.
James
I don't see the i2cObject in the Object Library. Is it under some other name? Does the update need to be done manually by Parallax? I would like to switch to using your "standard" version for my programs.
Mike
mmm. Well i've updated the object library - I guess Parallax haven't got arround to approving it yet.
I'll check again at the end of the day - sure it'll be done then!
Thanks,
James
The Parallax website seems to have died, and the object hasn't been posted so i've attached for you.
James
Post Edited (Javalin) : 7/27/2006 8:18:52 PM GMT
Have you set the object on the init to have (_i2cSDA, _i2cSCL, TRUE)??
Does it work if you comment out the:
if driveSCLLine == false
' dont do this if the SCL line is not pulled up with a resistor.
' as the line will stay in the last state
repeat until ina[noparse][[/noparse]i2cSCL] == _pinHigh
bit in the i2cStart function?
James
i2cSDA, _i2cSCL, TRUE
but apparently the program is either not writing to the EEPROM or reading the EEPROM.· I had no problem with V1.2 using my old Propeller board, but when I switched to the Demo board and V1.3 it wouldn't work.· There is just no way I can add a pullup resistor to the Demo board.· I thought about setting another pin high and using that to pull uo the SCL line but I don't have any spare pins.· Perhaps I could use on of the pins for the mouse since I'm an not using those pins.· Then I could go back to V1.2.
Sid
Sid
Sid, the SCL line is just one-way and setting P28 high rather than to input is what you have to do, but there are several places in the code where it's done and you do need to change all of them.
Sid
Until the 1.3 version gets fixed, I suggest you use my modified 1.2 version that specifically checks for SCL == 28 and actively drives SCL both high and low.
Try this one.· I've just been testing it with and without an SCL line pull-up on the PDB.· I've removed the i2cBits parameter from the i2cRead function as it was not being used!
Note :- you MUST have a pullup on the SDA line!
Sorry for the hassle.
James