Shop OBEX P1 Docs P2 Docs Learn Events
i2c eeprom and rtc — Parallax Forums

i2c eeprom and rtc

mctriviamctrivia Posts: 3,772
edited 2009-02-17 08:23 in Propeller 1
is it possible to share scl and sda between 2 ics like an rtc and the eeprom without using enable pins?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-14 06:21
    Yes.

    You can also have several EEPROMs, a RTC, and an I/O expander all on the same I2C bus. If you have more than one EEPROM or I/O Expander, you need to wire up different address select lines for them. The RTC is only designed for a single device address since it would be unusual to have more than one on an I2c bus.
  • mctriviamctrivia Posts: 3,772
    edited 2009-02-17 03:05
    i am using this rtc. datasheets.maxim-ic.com/en/ds/DS32B35-DS32C35.pdf does not seem to have any address lines like the eeprom does. if i am not mistaken then this would mean i can't use it on the same bus. if so can i share the scl line and have 2 sda lines?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-17 05:02
    You're correct, you can't put this part on the same SCL/SDA lines as a boot EEPROM since it uses the same device address as the boot EEPROM, but only provides 8K bytes at most. You could share the SCL line between the two I2C busses.
  • smbakersmbaker Posts: 164
    edited 2009-02-17 06:03
    If I'm reading the datasheet correctly (and I'm probably not...), it looks like the·DS32B35 has two different slave addresses:

    ·· 1010xxxR - flash ram
    ·· 1101xxxR - real time clock

    The flash ram address conflicts with the eeprom, but the clock does not. It looks like the chip has a separate SCL for the ram and the clock. If you didn't care about the internal flash ram and only wanted to use the clock, then perhaps you could tie the SCL for the ram high (or low), effectively disabling it?

    I have clock project currently using a DS1302; this would be an interesting alternative -- free up a few pins, and eliminate the need for an external crystal.
  • mctriviamctrivia Posts: 3,772
    edited 2009-02-17 06:12
    this is also more accurate then most out there which is why i wanted to use it. only problem i see with it though is you can't run any traces underneith it unless there is a ground plane between the ic and the traces meaning you need more then 2 layers or run everything on other side of the ic.
  • Carl HayesCarl Hayes Posts: 841
    edited 2009-02-17 06:24
    You can't put that particular RTC on the same SCL and SDA with your primary 24LC256 eeprom, because both have the same address 1010000; but you could use a different RTC, for example the DS1307, which has a different address 1101000.· The DS1340, another RTC with a slightly different assortment of features from the DS1307, also has the address 1101000 and could be used instead of the DS1307, sharing the same two pins with the primary 24LC256 eeprom.· I'm sure there must be others, too.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • mctriviamctrivia Posts: 3,772
    edited 2009-02-17 07:09
    i am not sure but I believe I can use this AT24C512B to replace the normal eeprom and have extra space left over.
  • dMajodMajo Posts: 855
    edited 2009-02-17 08:15
    @mctrivia
    I understand you: if you need high accuracy then the DS32C35 is far better than other solutions. While connected to propeller you can not use the builtin fram on the same bus as it conflicts with the boot eeprom (and could not go without the boot eeprom because the fram size is to small). The solution is to share the SDA and have separate SCL connections (the RTC SCL goes to the boot eeprom one). This solution will give you 8k of unlimited same speed read/write storage

    If you do not need such rtc accuracy then the ramtron FM31L278 alone will solve all you needs (RTC, boot eeprom replacement, and security issue from other post). The FM accuracy is up to the external crystal and also it have builtin compensation: of course is not temp compensated.
  • mctriviamctrivia Posts: 3,772
    edited 2009-02-17 08:23
    I ended up purchasing the DS1340 and a 20ppm crystal. much cheaper, requires less power(thus smaller battery) and though not as accurate at 20ppm with software compensation capabilities should do a pretty good job in most applications.
Sign In or Register to comment.