Charlieplexing of discrete leds has been the topic of a few other instructables. The Charlieplexing LEDs- The theory and the How to drive a lot of LEDs from a few microcontroller pins comes to mind. They are both excellent and should be read by anyone that wants to gain a deeper knowledge of how charlieplexing really works.
Charlieplexing 7-segment displays is more or less the same as doing it with discrete leds, but with some changes to handle the fact that all the led segments have a common pin instead of being separate, and the need for buffering of the common output so the poor microcontroller can cope with the load.
Remove these ads by
Signing UpStep 1: Why
Due to a shortage of available i/o-pins on the Atmel Tiny26 that I've used for the pulse generator project I couldn't use the standard multiplexed way of doing this. The standard multiplex would require 14 i/o-pins - 8 for the segments (don't forget the dot) plus 6 for the common anode/cathode of each display.
By Charlieplexing the displays I only need 9 i/o-pins and the displays are still muxed in a 1:6 way acheving the same brightness as standard muxing. Charlieplexing usually only light up one led at a time thus giving a reduced brightness if you want several leds to be (visibly) lit at the same time.
Of course I could have used a BCD-to-7segment decoder chip (74LS48) plus a 1-to-8 decoder (74LS138) but that would have been cheating, and i didn't have any '48ths as hand and I really wanted to be able to fit the pulse generator in an Altoids-like box.






































Visit Our Store »
Go Pro Today »




I've noew added a zipfile with an AVR Studio 4 project with recovered code....
There is only one critical comment I have thought: this is not Charlieplexing! I don't mind calling this approach Matsengplexing for future references, but actual Charlieplexing requires you to switch polarities of the LEDs around thus achieving an enormous amount of LEDs connected to limited amount of I/Os, such as 4 I/O to 12 LEDs. Switching polarities is not possible in LED matrices like these 7-segs where all 8 LEDs share a common cathode (or was it anode?) . Using actual Charlieplexing you would be able to light 72 LEDs from 9 I/Os, meaning more than 10 digits and two digital points. But of course, noone makes 7 segment indicators with all LEDs separately pinned on the back, so it's purely theoretical. Matsengplexing is the only approach possible.
Great job!
I was quite confused at first, but I think I've got it. The real trick is to realize that the uCPU lines are actually tri-state: high, low, and high-impedance (disconnect). This design takes advantage of all 3 states. Using this matseng has used HIGH to select a display and LOW to select a segment:
1. The "sink" on each display is connected to a DIFFERENT line (look very closely at the diagram). You drive this line HIGH to select the display.
2. Now, the actual segments are wired almost like normal, except that one of them will no be connected to the new data line (the one that would have been connected to the line you just drove high). You need to drive the segments you want on LOW.
3. Unlike a standard design, you MUST set the segments you don't want enabled to high-impedance (singe high would select a 2nd display, and low would select another segment).
PS: matseng - very clever, and useful!