Is there a Tri-State Shift Register?

I have a 4-digit 7-segment common-cathode display I'm trying to control with the least amount of pins possible.

So here was my approach until I got stuck: Use an hc74HC595 to drive the 8 pins and then toggle the remaining four ground pins to get a the desired output. However, this still uses 7 precious pin.

My idea is to find a shift register that has at least 8 regular high/low outputs, and at least 4 high/low impedance pins. It does not have to latch since I have to keep updating the display anyways.

Please let me know if there is such a shift register or a different approach I can use.

Thanks!

Couldn't you just use 2 shift registers? That's what I've done for 4 digit displays before. It even leaves a few pins on the second shifter free so you can add an LED or two.

Do not cross-post. Other thread removed.

serg10: I have a 4-digit 7-segment common-cathode display I'm trying to control with the least amount of pins possible.

If you truly want to do that, you use a MAX7219. That's exactly for what a MAX7219 exists. Three pins to control it, and it does the multiplexing for you. And takes far less PCB real estate. And it gives you better brightness than HCMOS shift registers (because although it multiplexes, it is rated for more current overall).

serg10: My idea is to find a shift register that has at least 8 regular high/low outputs, and at least 4 high/low impedance pins. It does not have to latch since I have to keep updating the display anyways.

Obviously, a 74HC595 has tri-state outputs. I suspect you want individually controllable tri-state outputs and the only things that have that, are things like the ATmega328. :grinning:

[quote author=Coding Badly link=msg=2024804 date=1420174402] Do not cross-post. Other thread removed. [/quote]

I wasn't sure where to post it in the LED section or here so I did both :P. Sorry about that, I'll read the rules more carefully.

Delta_G: Couldn't you just use 2 shift registers? That's what I've done for 4 digit displays before. It even leaves a few pins on the second shifter free so you can add an LED or two.

The shift register only gives a high or low output (or all high impedance) but I need individual high or low impedance control on those four pins so that will not work.

Paul__B: If you truly want to do that, you use a MAX7219. That's exactly for what a MAX7219 exists. Three pins to control it, and it does the multiplexing for you. And takes far less PCB real estate. And it gives you better brightness than HCMOS shift registers (because although it multiplexes, it is rated for more current overall). Obviously, a 74HC595 has tri-state outputs. I suspect you want individually controllable tri-state outputs and the only things that have that, are things like the ATmega328. :grinning:

Yes that works for what I need! But those chips are crazy expensive ($10 for a few or $4 for 1k!) I'm looking to build a few dozen of these displays and this is throwing me way over budget and individual board size constraints. There must be another way. Haha yes, that's the word I'm looking for, an individually controlled tri-state output!

Hmm, so I did some Googling with that term and learned about 74LS125 tri-state buffer. Would it be possible to control this from a shift register and use that for the high/low impedance control. I have a feeling there is some genius analog solution to this problem, I just can't come up with lol. Any analog wizards out there have any input?

The standard solution is to use a MAX7219 or two shift registers, one driving the segments and the other driving the digits. You need a NPN transistor such as the 2N2222 per digit to pull the cathode digits to ground for active digits. The per pin current rating of a 74HC595 is too low, hence the transistors. You can skip the transistors if you use a high power shift register such as the TPIC6B595 that has FETs driving the outputs.

This schematic shows a MCU and NPN transistors driving a display. The MCU is driving the digits, but you can as easily use another 595 daisy chained to the first shift register (saving you pins on the MCU):

Hope this helps!

serg10: But those chips are crazy expensive ($10 for a few or $4 for 1k!) I'm looking to build a few dozen of these displays and this is throwing me way over budget and individual board size constraints.

Wait on, you have a few things wrong there!

First, as I explained, the performance of your arrangement of shift registers and transistors is going to be inferior to the MAX7219 unless you include both anode and cathode drive transistors - a total of 12 for 4 digits.

Secondly, you have argued against yourself if you talk of "board size constraints" because a MAX7219 is one IC (to drive anything up to eight digits) and one resistor against multiple ICs, 12 transistors and 16 resistors. Or a few less transistors and resistors if you use a TPIC6B595 but still get inferior performance.

With the increased board size goes increased assembly costs.

Now I also wonder whether you are comparing "apples with apples" when you obtain all those parts from the same supplier as you would, the MAX7219. While there are some dodgy supplies, I have one or two dozen of the cheap eBay MAX7219s here and while I have not tested them all yet, I have yet to find any faulty so far.

And - rather amusingly, you mentioned a 74LS125 - an obsolete logic family!

(OK, you meant 74HC125 ;D )

serg10: My idea is to find a shift register that has at least 8 regular high/low outputs, and at least 4 high/low impedance pins. It does not have to latch since I have to keep updating the display anyways.

The most you'll find is 8 parallel I/O on a shift reg I believe, the 74HC299 does everything except latch so might be appropriate.

but I need individual high or low impedance control on those four pins so that will not work.

Actually, NO you don’t. If you pull the cathodes of the inactive digits HIGH, all of those segments will be extinguished.

KenF:
Actually, NO you don’t. If you pull the cathodes of the inactive digits HIGH, all of those segments will be extinguished.

That’s what I was about to say. If you’ve got +5V on either end of an LED it’s not going to light at all. The pins you set to LOW will be grounds and that light will light up, but if you set the pins where the cathodes are going HIGH they will turn off the lights. You don’t need a high impedance pin anywhere to do what you want to do.

I know because I have built tens of 4 digit displays and every one of them has a pair of shift registers to control everything. It works great. One shift register for the individual bits, and a second one for the 4 cathodes. It leaves 4 pins out on that second shifter so I often use those for driving another LED or two if I need them for indicators or something.

PetriH: The standard solution is to use a MAX7219 or two shift registers, one driving the segments and the other driving the digits. You need a NPN transistor such as the 2N2222 per digit to pull the cathode digits to ground for active digits. The per pin current rating of a 74HC595 is too low, hence the transistors. You can skip the transistors if you use a high power shift register such as the TPIC6B595 that has FETs driving the outputs.

This schematic shows a MCU and NPN transistors driving a display. The MCU is driving the digits, but you can as easily use another 595 daisy chained to the first shift register (saving you pins on the MCU): http://4.bp.blogspot.com/-ZiBYwHrSZaY/UXLnPhg-qqI/AAAAAAAAAB8/uJHqcTmR_xg/s1600/schematic_small_fixed.jpg

Hope this helps!

Yes that helps alot! Thanks!

Paul__B: Wait on, you have a few things wrong there!

First, as I explained, the performance of your arrangement of shift registers and transistors is going to be inferior to the MAX7219 unless you include both anode and cathode drive transistors - a total of 12 for 4 digits.

Secondly, you have argued against yourself if you talk of "board size constraints" because a MAX7219 is one IC (to drive anything up to eight digits) and one resistor against multiple ICs, 12 transistors and 16 resistors. Or a few less transistors and resistors if you use a TPIC6B595 but still get inferior performance.

With the increased board size goes increased assembly costs.

Now I also wonder whether you are comparing "apples with apples" when you obtain all those parts from the same supplier as you would, the MAX7219. While there are some dodgy supplies, I have one or two dozen of the cheap eBay MAX7219s here and while I have not tested them all yet, I have yet to find any faulty so far.

And - rather amusingly, you mentioned a 74LS125 - an obsolete logic family!

(OK, you meant 74HC125 ;D )

Your right about that. I hadn't even considered that. Wow those chips are crazy cheap on Ebay I'm gonna pick up a few and see how it goes. Thanks!

KenF: Actually, NO you don't. If you pull the cathodes of the inactive digits HIGH, all of those segments will be extinguished.

Delta_G: That's what I was about to say. If you've got +5V on either end of an LED it's not going to light at all. The pins you set to LOW will be grounds and that light will light up, but if you set the pins where the cathodes are going HIGH they will turn off the lights. You don't need a high impedance pin anywhere to do what you want to do.

I know because I have built tens of 4 digit displays and every one of them has a pair of shift registers to control everything. It works great. One shift register for the individual bits, and a second one for the 4 cathodes. It leaves 4 pins out on that second shifter so I often use those for driving another LED or two if I need them for indicators or something.

I didn't think that was possible but it seems so obvious now. Thanks guys.

A perfect example of an XY problem as described here:- http://xyproblem.info/