n8huntsman wrote:Check out pages 8 and 9 of this for a good schematic and explanation of charlie-plexing. This really helped be get my head around it.
http://downloads.eshepherdsoflight.com/Howidid-MidiTree.pdf
Actually, that is just an example of multiplexing, rather than Charlieplexing. With Charlieplexing, the state of each output effects the resultant selection, where in DonJ's megatree, each of 12 outputs controls a branch, while two outputs are used to select one-of-four colors for all branches.
Charlieplexing will light (or not light) one of two LEDs (or strings) for EACH PAIR of outputs. For example, (for two outputs) If A is high and B is low, then D1 lights; if A is low and B is high, then D2 (which is wired back-to-back with D1) lights. If A and B are both high or both low, then neither D1 nor D2 light. Again, the rule is N*(N-1) lights for N outputs. In this example, 2*(2-1)=2. The advantage comes when you build up the number of outputs feeding the matrix.
However, as you increase, you lose discrete control, unless you can tri-state (open-circuit) the outputs. Lacking that capability, for 8 bits of data, you can control 8*(8-1)=56 lights. Since there are 256 possible states (ON or OFF) of 8 bits, there are only two states with all lights off (00000000 and 11111111). All other bit patterns will result in 7, 12, 15, or 16 lights on. Actually 7 occurs 16 times, 12 occurs 56 times, 15 occurs 112 times, and 16 occurs 70 times. Each light is on in 64 of the 256 states.
(Isn't matrix math fun????) 🙄 🙄 🙄 🙄
As usual, I've gone on way too long, but that's me... (see my signature):D
WireWrap wrote:Charlieplexing will light (or not light) one of two LEDs (or strings) for EACH PAIR of outputs. For example, (for two outputs) If A is high and B is low, then D1 lights; if A is low and B is high, then D2 (which is wired back-to-back with D1) lights. If A and B are both high or both low, then neither D1 nor D2 light. Again, the rule is N*(N-1) lights for N outputs. In this example, 2*(2-1)=2. The advantage comes when you build up the number of outputs feeding the matrix.However, as you increase, you lose discrete control, unless you can tri-state (open-circuit) the outputs. Lacking that capability, for 8 bits of data, you can control 8*(8-1)=56 lights. Since there are 256 possible states (ON or OFF) of 8 bits, there are only two states with all lights off (00000000 and 11111111). All other bit patterns will result in 7, 12, 15, or 16 lights on. Actually 7 occurs 16 times, 12 occurs 56 times, 15 occurs 112 times, and 16 occurs 70 times. Each light is on in 64 of the 256 states.
Also, by adding bipolar transistors across the resistors, you can increase the I/O pin drive capability so that you can turn on multiple LEDs within a "row" of LEDs without burning out the I/O pin. An EDN article about "chipiplexing" a while back described that trick.
don
djulien wrote:Also, by adding bipolar transistors across the resistors, you can increase the I/O pin drive capability
Of coarse as you know, using an appropriate optocoupler will allow you to drive nearly anything you want.
ErnieHorning wrote:Of coarse as you know, using an appropriate optocoupler will allow you to drive nearly anything you want.
I was thinking that optocouplers are used more for voltage isolation, but that's an interesting idea to use them for current protection purposes also. thanks.
don
pretty neat 🙂
