Shop OBEX P1 Docs P2 Docs Learn Events
sharing eeproms i2c bus? — Parallax Forums

sharing eeproms i2c bus?

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2012-10-15 12:38 in Propeller 1
I seem to recall reading some posts that led me to belive there may be problems sharing the same i2c bus as the eeprom with other perepherials, although im not sure so i wanted to see if what im attempting to do is number 1 easy and number 2 possible.

id like to add a ds1307 rtc and mcp23017 gpio expander on the same i2c bus as the eeprom. physically wiring this is obviously not an issue but would it be an issue for an end user just downloading the obex code and using the board? i seem to recall something about the chips having to wait for the eeprom to finish loading or something along those lines when sharing the eeproms i2c lines

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-10-13 00:21
    They are just two GPIO lines that are used for I2C access to the EEPROM during boot and programming and no other time unless methods are used to do so. So in other words there is no problem and if the Prop itself is accessing the EEPROM then obviously no other user programs are running or could be run. I use these lines all the time for other I2C devices and even sneak the clock and data for SPI devices too.
  • JonnyMacJonnyMac Posts: 9,108
    edited 2012-10-13 00:26
    I did a project last year with a DS1307 and two MCP23017s on the same buss as the boot EEPROM. No problems with well-behaved code.
  • BigFootBigFoot Posts: 259
    edited 2012-10-14 11:38
    We have a touch screen controller, two 16 I/O chips, a digi pot and rtc sharing our I2C bus with the eeprom and there are no problems.
    This is what the bus was designed to do but it is not very fast.

    Russ
  • Andrew E MileskiAndrew E Mileski Posts: 77
    edited 2012-10-15 12:38
    Be aware that the Prop's I2C signalling for booting doesn't support multi-master nor clock stretching, as SCL is driven high instead of using a pull-up resistor. This shouldn't ever be a problem with EEPROM devices, but may be with other slow devices, for example: an analog to digital converter (ADC).

    There are Prop I2C drivers that support clock stretching, with the addition of a pull-up resistor on SCL. Instead of driving SCL high, it is three-stated (driver manipulates DIRx bits instead of OUTx bits), and therefore pulled-up by the resistor. Driving SCL low isn't a problem, as current sinked will be limited by the pull-up resistor.

    For multi-master, I recommend a Schottky diode (example: 1N5817) on SCL with the cathode towards the Prop, followed by the pull-up resistor, to prevent the Prop from driving SCL high during its boot sequence, or simply using another pair of pins for a general I2C bus.
Sign In or Register to comment.