Electronics > Projects, Designs, and Technical Stuff
Amusing 5 pin 7 segment LED display
(1/2) > >>
Renate:
My apologies if this is old hat, but I've never run into it before...

Everybody knows those 4 digit 7 segment displays.
They have 4 common pins and 7 (+1 for the decimal point) segment pins.
Everything is arranged electrically in a little rectangle, 4 x 8 = 32 lightable thingies.

I found a trashed USB power bank on the highway.
It had a cute little 2.5 digit (188) LED display on it.
I thought that I'd salvage it.
I was amazed to see that it connected on only 5 pins.

I scratched my head.
If it were 2 rows and 3 columns, that would be 6 lightable thingies.

What they are doing is connecting between every pin and every other pin an LED.
Ok, but that would be 5 * 4, (then divided by 2 since polarity does matter) = 10 lightable thingies.
But! They have LEDs going in both directions between all the pins, 5 * 4 = 20 lightable thingies.
Since this is a 2.5 digit (without decimal points) we only need 16 lightable thingies.

So what we have is actually a square matrix (with the row drivers and the column drivers being the same).
It has a dimension of 5 * 5 (minus of course the 5 where the row and column is the same, i.e. the diagonal) = 20 active crosspoints.
Since we are only using 16 crosspoints, we could use the remaining 4 as pushbutton inputs (with an isolating diode).

Since we're driving LEDs and they need a resistor and there's no division between rows and columns, each of the 5 leads gets a resistor, 1/2 of the value we'd want.

The advantage to all this is that you only need 5 pins out of your uP.
The disadvantage is you have to do wacky bit bopping to determine the right segment.

Since builtin pullups on uPs are easy, I have the multiplexing work by grounding 1 of the 5 pins and either Hi-Z or VSS on the other pins.
Without reading any extra pushbuttons, a 4 phase refresh will do.
With pushbuttons you need 5 phases.
Of course, you could make this 16 (or 17) phase to make sure that the drop across the resistors is absolutely uniform.
Nusa:
https://en.wikipedia.org/wiki/Charlieplexing
mikerj:
This is a technique called Charlieplexing which has been around for quite a long time.  I've not seen a multi digit seven segment display package specifically manufactured to use this method though, so it's an interesting find.
Renate:
Ok, well, Charlieplexing.
I'm not really impressed.

To do this properly with LEDs you need either to use a phase per LED or use a special driver that can do all 3 for each pin.
1) A hard drive (unlimited current)
2) Hi-Z
3) Current limited drive.

So, for 64 LEDs we need 9 lines with Charlieplexing.
For a standard matrix we'd need 16! OMG!
But the 8 columns drives aren't real data, it's actually 3 bits of actual information.
So, we'd need 11 lines out of the processor (and a 3-8 driver).
So for saving 2 lines out of the processor we're going to jump through all these hoops?
Ever try debugging a Charlieplex?
Ever see the two LED paths dimly glowing because of leakage?

It's cute, but engineering isn't always about cute.
Nusa:
You asked how it was done. Didn't say it was recommended in the general case. When you have a large number of segments, you're better off with a dedicated LED driver in most cases, rather than trying to find enough controller pins.
Navigation
Message Index
Next page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod