Shop OBEX P1 Docs P2 Docs Learn Events
I2C address two chips with on rotary dip switch? — Parallax Forums

I2C address two chips with on rotary dip switch?

James LongJames Long Posts: 1,181
edited 2009-12-17 13:33 in General Discussion
Ok, so I want to have two chips on a board, but I need to be able to change their addresses.

Is there a way to take a single rotary dip switch and change both addresses?

The addresses go from 0 to 15.

I've been thinking about this, and I can't find a way to do this simply without using up all the addresses with just a couple of chips.

Anyone have any ideas?

James L

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
James L
Partner/Designer
Lil Brother SMT Assembly Services

Are you addicted to technology or Micro-controllers..... then checkout the forums at Savage Circuits. Learn to build your own Gizmos!

Comments

  • ZootZoot Posts: 2,227
    edited 2009-12-17 02:53
    The rotary is a common -> one of 15?

    Couldn't you use diodes on each out pin of the rotary and tie them to multiple address pins (or not) on the I2C chips? You'd also need weak pullups on all the address pins. That's 15 diodes and 16 pullups, though.

    You can't use an 8 pos DIP switch which would let you set addresses on both? I'm presuming 3 address pins on the I2C devices. Wait I guess you mean 4 address pins since you mentioned addresses from 0-15?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • James LongJames Long Posts: 1,181
    edited 2009-12-17 02:59
    Zoot said...
    The rotary is a common -> one of 15?

    Couldn't you use diodes on each out pin of the rotary and tie them to multiple address pins (or not) on the I2C chips? You'd also need weak pullups on all the address pins. That's 15 diodes and 16 pullups, though.

    You can't use an 8 pos DIP switch which would let you set addresses on both? I'm presuming 3 address pins on the I2C devices. Wait I guess you mean 4 address pins since you mentioned addresses from 0-15?

    Zoot,

    Sorry, I meant 0-7. I don't know what I was thinking. I was jelly brained when posting. I have looked at all kinds of methods to do the addressing, but it looks as if the only way would be two dip rotary switches. It probably wouldn't be very effective to have a bunch of other components, for I can just do it with two switches. I just wanted to make it easy for the end user. I guess documentation will need to be written for that part.

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer
    Lil Brother SMT Assembly Services

    Are you addicted to technology or Micro-controllers..... then checkout the forums at Savage Circuits. Learn to build your own Gizmos!
  • kwinnkwinn Posts: 8,697
    edited 2009-12-17 04:33
    If you tie one address line on one chip high and the other chip low you could use the switch to set the rest of the address lines. The result would be one chip at xx0 and the other at xx1.
  • James LongJames Long Posts: 1,181
    edited 2009-12-17 04:56
    kwinn said...
    If you tie one address line on one chip high and the other chip low you could use the switch to set the rest of the address lines. The result would be one chip at xx0 and the other at xx1.

    I tried that scheme, but for some reason it didn't work out in my head.

    I'll have to go through the switch settings again with your idea.

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer
    Lil Brother SMT Assembly Services

    Are you addicted to technology or Micro-controllers..... then checkout the forums at Savage Circuits. Learn to build your own Gizmos!
  • James LongJames Long Posts: 1,181
    edited 2009-12-17 13:33
    Kwinn,

    You are right. If I use the bottom address lines as hard addressed, and start at the first switch connection after those, it works out fine.

    I actually had to sit down and do it on paper to figure it out. The mind is not as sharp as it once was.

    I appreciate the insight. I tried to figure it out, but I kept having addresses skip. It was because of the way I was trying to connect the binary switch.

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer
    Lil Brother SMT Assembly Services

    Are you addicted to technology or Micro-controllers..... then checkout the forums at Savage Circuits. Learn to build your own Gizmos!
Sign In or Register to comment.