How to use Basic_12C_Driver or 12COject please???
whiteoxe
Posts: 794
Hi All,
I have been reading Javlin notes on EEPROM usage without getting too far just yet. Even the wiring I am unsure of. Is it easier to connect my second 32k EEPROM to the one I have or use two new pins on the prop and if so should I NOT pullup SCL and or SDA (javlin notes pullup both with 4.7K R)? The Object notes I think say NO to answer my own question. I have SDA with a pullup on the EEPROM the prop uses for running code.
I need an example of how to use the code for a READ and WRITE. I dont understand much about this object. Thanks.
I have been reading Javlin notes on EEPROM usage without getting too far just yet. Even the wiring I am unsure of. Is it easier to connect my second 32k EEPROM to the one I have or use two new pins on the prop and if so should I NOT pullup SCL and or SDA (javlin notes pullup both with 4.7K R)? The Object notes I think say NO to answer my own question. I have SDA with a pullup on the EEPROM the prop uses for running code.
I need an example of how to use the code for a READ and WRITE. I dont understand much about this object. Thanks.
Comments
The Basic_I2C_Driver is straightforward to use, has some simple examples in the comments. Remember that there needs to be a 5ms delay after writing to the EEPROM.· There's a WriteWait routine that shortens this time by checking the EEPROM for a response which comes when it's done with its write cycle.
If you connect a 2nd EEPROM to pins 28/29, make sure to change the address pins of the new EEPROM to something other than all zero bits.
Post Edited (Mike Green) : 11/4/2009 12:39:23 AM GMT
The Basic_I2C_Driver is straightforward to use, has some simple examples in the comments <-- i didnt see any.
Would have been very helpful to me if you understood my lack of being able to understand or i wouldnt have asked for help.
I need an example of how to use the code for a READ and WRITE. I dont understand much about this object. Thanks.
That's the code to write and there is code for read just a few lines above, both included in the Basic_I2C_Driver.spin. And please make sure you read and understand the comments below that.
Usually ALL objects contain demo-code that uses the object. Up to now I did not find any object that needed additional explination and were running right out of the box.
If you still have problems feel free to ask again, that's what the forum is good for.
·
Look at the i2cDemoApp.spin file in the i2cObject zip file. Its got a full set of example's of all the sub-objects (eeprom read & write, temperature, motor control etc) and a wiring diagram in the top of the file.
>it easier to connect my second 32k EEPROM to the one I have or use two new pins on the prop
yes.· Change the address of the second EEPROM - typically this is done by connecting the address pins to +5v or GND.· Each device on the bus must have a unique address.
>I NOT pullup SCL and or SDA
as Mike was saying - it depends what board your using - i.e. a Propeller demo board, or Propeller Professional Dev board, etc. If its a·Parallax one then they have the·schematics on their website for·the boards - have a look.· If·its·your own/other then SCL/SDA lines need one pull up each of approx 4.7k to +3.3v.
>I have SDA with a pullup on the EEPROM the prop uses for running code.
No - the bus needs a pull up - not each device.· Kinda link turning the tap on on the hose - you only need to do it once.
James
Post Edited (Javalin) : 2/2/2010 9:29:29 PM GMT
mIKE.