Multiple I2C devices
Neighborhood Physicist
Posts: 32
I would like to add extra eeprom to the propeller and possibly some othe I2C devices.·
How does the propeller know which eeprom device to load from?
Does this mean I am goin to have to put a power switch for all other I2C devices, so that they will stay off until the Propeller boots up?
Also, I have seen alot of SPIN I2C objects, but is there any assembly code for the I2C for max speed.
Thanks for the help.
How does the propeller know which eeprom device to load from?
Does this mean I am goin to have to put a power switch for all other I2C devices, so that they will stay off until the Propeller boots up?
Also, I have seen alot of SPIN I2C objects, but is there any assembly code for the I2C for max speed.
Thanks for the help.
Comments
I haven't seen any assembly for I2C...
The first byte of an I2C read or write holds this address together with a constant ID and the R/W bit. So you can access different addresses and devices over the same I2C bus.
Does this mean we are confined to using the eeprom shipped from parallax?
Also can you use a 64K eeprom and use the upper 32K for storing user defined variables?
And some devices that don't have any address pins can be purchased with different addresses (different part #, same device, different address). For instance the microchip MCP3221 is a SOT23 5 pin A to D converter that normally comes addressed to "5", but can be purchased at address "0" or special ordered at an other address.
Bean.
Post Edited By Moderator (Chris Savage (Parallax)) : 11/2/2007 3:42:12 PM GMT
Yes, in fact Parallax's Proto Board comes with a 64K eeprom. One nice feature is, when you load a program into the eeprom, it only overwrites the lower 32K. The upper 32K stays intact, so if you have data stored in this area, you don't loose it when you load a revised program.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian
uController.com - home of SpinStudio
PropNIC - Add ethernet ability to your Propeller!
SD card Adapter
Above 64K EEPROM size, different manufacturers have different schemes for addressing, so you can't combine chips from different manufacturers. You can have two 128Kbyte chips from Atmel on the same I2C bus for a total of 256Kbytes. You can have four 128Kbyte chips from Microchip on the same I2C bus, but the addressing scheme is screwy if you plan to have only one chip some of the time. As these larger sizes become more popular, I'm sure the manufacturers will sort this out so they can second source each others' parts. That's what happened with the smaller sizes after a few years.
I used the I2C PCA9532 16 bit led driver. The fun about this was to find out how long a I2C line can be with out repeater.
i have 32 light units with each 2 rgb 1 white led and a PCA9532. They are conected via cat5 cable.
some have the same I2C adress and some have other so i get some groups.
The total cable run is made out of 3foot 5 foot and 10 foot cables a total of 160 foot.
And it works like a charm.