Shop OBEX P1 Docs P2 Docs Learn Events
Multiple I2C devices — Parallax Forums

Multiple I2C devices

edited 2007-11-03 16:07 in Propeller 1
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.scool.gif
Thanks for the help.

Comments

  • RaymanRayman Posts: 14,162
    edited 2007-11-02 12:45
    It knows by the address. All I2C chips have an address. Some address bits are hard coded, usually there are a few pins on the chip that also set some bits of the address. All you have to do is make sure no two chips have the same address on the bus...

    I haven't seen any assembly for I2C...
  • AribaAriba Posts: 2,685
    edited 2007-11-02 12:48
    Every I2C EEPROM has a 3 Bit address, that is defined with 3 pins of the EEPROM. The Propeller boots from the EEPROM with address 0, so you just have to give the other EEPROM another address.
    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.
  • edited 2007-11-02 12:51
    I don't know for certain but wouldn't different manufacturers chips have different addresses.
    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?
  • BeanBean Posts: 8,129
    edited 2007-11-02 13:50
    Most I2C devices have 3 pins that allows YOU to set the address. Some small devices might only have 1 or 2 of the address pins, some might not have any.

    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
  • parts-man73parts-man73 Posts: 830
    edited 2007-11-02 14:16
    Neighborhood Physicist said...
    Also can you use a 64K eeprom and use the upper 32K for storing user defined variables?

    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
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-02 15:11
    The Hydra is an example of an expandable Propeller system with 128Kbyte of EEPROM on the main board and a plug in memory card with an additional 128Kbyte of EEPROM. When you plug in the card, some additional logic changes the address select bits on the main board EEPROM so it looks like it's in the 2nd 128K block of addresses while the expansion card memory replaces the 1st 128K block (which includes the 32K boot area).

    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.
  • AnubisbotAnubisbot Posts: 112
    edited 2007-11-03 16:07
    Hi, i just finished a project with 64 RGB leds and 32 white leds all driven by a propeller.
    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.
Sign In or Register to comment.