Shop OBEX P1 Docs P2 Docs Learn Events
I2C silly addressing question — Parallax Forums

I2C silly addressing question

ArchiverArchiver Posts: 46,084
edited 2002-10-27 08:42 in General Discussion
I need to use 2 I2C chips at once (finally) but I can't seem to find
any description on how to set the addresses!

All examples I've seen are single chip and all set the three address
pins low. I'm assuming I'd use a pullup resistor (say 10k) on A0 and
ground the other two to give a chip address of "1" but, A1 for an
address of "2" and A0+A1 for 3, etc. I'm a bit leary about frying a
chip though so can anyone confirm this for me?

Signed Chicken Little.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-10-25 13:56
    I'm working on a couple of things right now that use multiple I2C
    devices. 10K pullups on the address pins work well, once I overlooked
    the pullups and just connected the address pins directly to +5V, and the
    chip lived to tell the story.

    Your addressing logic is correct, pulling A0 up will give the chip an
    address of "1", all the way up to pulling all pins up for an address of
    "7".

    (you may already be aware of this), most I2C pins seem to have the LSB
    for the address in the left/top position (depending on how you look at
    the chip), while the stamp example code puts the LSB in the rightmost
    position, so your code will have the address bits in the "mirror image"
    of the pullups on the chip.

    All in all, the I2C support is awesome, using 2 pins I can communicate
    with an RTC, an ADC, some extra RAM and an LCD...

    On Fri, 2002-10-25 at 08:16, ghidera2000 wrote:
    > I need to use 2 I2C chips at once (finally) but I can't seem to find
    > any description on how to set the addresses!
    >
    > All examples I've seen are single chip and all set the three address
    > pins low. I'm assuming I'd use a pullup resistor (say 10k) on A0 and
    > ground the other two to give a chip address of "1" but, A1 for an
    > address of "2" and A0+A1 for 3, etc. I'm a bit leary about frying a
    > chip though so can anyone confirm this for me?
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-10-25 14:43
    It's no big deal. Just connect an address pin for Vdd (+5) for a "1" or to
    Vss (ground) for a "0." You won't fry anything by connecting directly -- but
    the pull-ups are not hurting anything either.

    -- Jon Williams
    -- Parallax

    In a message dated 10/25/02 7:16:59 AM Central Daylight Time,
    ghidera2000@y... writes:


    > I need to use 2 I2C chips at once (finally) but I can't seem to find
    > any description on how to set the addresses!
    >
    > All examples I've seen are single chip and all set the three address
    > pins low. I'm assuming I'd use a pullup resistor (say 10k) on A0 and
    > ground the other two to give a chip address of "1" but, A1 for an
    > address of "2" and A0+A1 for 3, etc. I'm a bit leary about frying a
    > chip though so can anyone confirm this for me?
    >
    >




    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2002-10-27 08:42
    I've just finished a Datalogger that uses 4 I2C chips.
    An RTC, 2 x EEPROM, and a I2C to Parallel chip.

    go to http://www.lennard.net.nz/electronics/ad.html#datalogger2
    to have a look.

    I've had a bit of fun with it over the last 2 days - logging the
    temperature in my lounge, light level, and other things.

    The code is a mess, but it's not bad for a first attempt.

    Menu driven user interface, etc...

    cheers,

    Ben, Wellington, New Zealand.

    --- In basicstamps@y..., "ghidera2000" <ghidera2000@y...>
    wrote:
    > I need to use 2 I2C chips at once (finally) but I can't seem to
    find
    > any description on how to set the addresses!
    >
    > All examples I've seen are single chip and all set the three
    address
    > pins low. I'm assuming I'd use a pullup resistor (say 10k) on
    A0 and
    > ground the other two to give a chip address of "1" but, A1 for an
    > address of "2" and A0+A1 for 3, etc. I'm a bit leary about frying a
    > chip though so can anyone confirm this for me?
    >
    > Signed Chicken Little.
Sign In or Register to comment.