Shop OBEX P1 Docs P2 Docs Learn Events
Is there such a thing as a tri-state output expander? — Parallax Forums

Is there such a thing as a tri-state output expander?

Professor ChaosProfessor Chaos Posts: 36
edited 2009-02-19 06:22 in BASIC Stamp
I want to control a bank of 20 or so LEDs. However, because of the way the LEDs are installed, each pins controlling the LEDs must be capable of being either HIGH, LOW, or INPUT. (Some of the LEDs have leads tied together, and some light combinations require a pin to be high-impedance and let the other pins connected to the LEDs be +5 or GND).

Is there any output expanding chip that lets you set outputs individually to +5, GND, or high-Z? Of course it has to be able to handle the amperage for a bunch of LEDs as well.

Thanks!

Comments

  • Carl HayesCarl Hayes Posts: 841
    edited 2009-02-17 07:03
    Well, you could use, for example, the 74LS125A which is a quad tri-state buffer.· Each buffer requires two inputs (has to, because it has three states).· Or 74LS126A which has opposite logic on the enable input.· With either of these, the two input lines set the single output line High, Low, or Open.· There are four such circuits per package.

    Then for 20 LEDs you'd need five (max)·of these packages, and you'd need 40 bits (max) of input information (two bits per buffer).

    To provide the 40 bits, you could string five 74LS164 eight-bit shift registers end-to-end to form a 40-bit shift register.

    You'd need only two output pins to clock 40 bits into the shift register.

    What your program would do is formulate a 40-bit data string (five bytes).· The string would consist of 20 dibits.· Each dibit would be formulated to set that particular 74LS125A output High, Low, or Open.· Shift in the 40 bits and your LEDs are lit, or dark, depending on the way they're connected.

    If the LEDs are connected (multiplexed) in such a way that you need fewer than 20 High/Low/Open lines (sounds like it, but your exposition is a little unclear), then of course the shift register could be shorter than 40 bits.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • Craig EidCraig Eid Posts: 106
    edited 2009-02-17 18:54
    Professor,

    You may be able to use a combination of the tri-state (74LS125A) and the 74HC595 if your LED's can withstand a reverse bias of 5 volts and you have pins that are common anode. You would drive the common anodes with the '595, latching the outputs as needed, and drive the devices requiring the tri-state with the '125.

    Post if you have any questions and have fun!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Craig Eid

    www.TriadRD.com
  • metron9metron9 Posts: 1,100
    edited 2009-02-18 02:21
    Why not just charlieplex them?
    http://members.ziggo.nl/electro1/avr/kitt.htm

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-18 02:44
    There's a variety of I/O expanders that interface using I2C and have tri-state outputs (high / low / input - high impedance). They're limited to about 20mA per I/O pin but that's what you'll find for most IC logic outputs. Check with the specific datasheet for the circumstances for each device. NXP has some and Microchip has some.
  • Professor ChaosProfessor Chaos Posts: 36
    edited 2009-02-19 06:22
    Ok, thanks for the answers. I have a Microchip 23017 and it looks like it will fit the bill - 16 I/O ports and each can be configured as an input or an output.
Sign In or Register to comment.