Hi there,

Although three state multiplexing has been around for some time now,

there are still a few mysteries that havent gotten around too well yet.

There are two problems in particular that i would like to discuss,

with the first being rather simple but the second even Wikipedia

didnt get right.

One is the total number of LEDs that can be scanned with a given

number of control lines. This is easily solved however by examining

a few examples and realizing that it's the simple permutations forumla:

P(n)=n!/(n-2)!

where the exclamation point represents factorial and is equal to:

n!=1*2*3*...*n

so for n=3, n!=6.

What P(n) tells us is the total number of LEDs that can run off of

a given number of control lines, n, so we know what to expect.

For example, say we only have 3 control lines...

P(3)=3!/(3-2)!=6/1=6

so, we can control 6 LEDs with 3 control lines.

Also of some interest is that the formula, knowing the number

of LEDs for a given n, when we want to increase the number of

control lines by 1 is even simpler:

P(n+1)=P(n)+2*n

or stated another way, if n=3 we know that this will control 6

LEDs, so if we increase n by 1 (to n=4 for four control lines)

the number of LEDs would increase by 6, because 2*3=6, so

we would end up being able to control a total of 12 LEDs

(6+6=12).

The second problem is a lot less commonly known. Wikipedia

as of 12/11/2008 states that each LED is driven one at a time,

and although this CAN be the way to do it, it's not the ONLY way,

and in fact this takes a much higher scan frequency and also may

reduce the duty cycle too low to be successfully used for some

number of LEDs or LED segments. There is a limit that is reached

once we get to a larger number of LEDs where if you turn one on

at a time you reduce the duty cycle so low that it would take a

current that is much above the peak rating of the LED to drive it.

Even a 5 to 1 peak rating isnt good enough in some cases.

This means an alternate way of scanning has to be incorporated

in order to both scan the LEDs correctly and also to keep the duty

cycle high enough so that a reasonable peak current can be

employed to make sure the LEDs shine bright enough for a typical

display.

If the LEDs are divided up into rows and columns similar to when

standard multiplexing is used but instead using three state

multiplexing the LED duty cycle can be kept higher and still

able to drive more LEDs than with standard multiplexing.

I had worked out a scheme for 100 LEDs but i am a loss as to

where it is on the web now, especially since AOL has graciously

discontinued allowing members to post web pages in Hometown

now. It does exist on the web somewhere else, so i'll just have to

find it before i can post here with the results.

Since the point of this thread is to do 1000 LEDs however, that will

take a bit more planning and perhaps even dividing up the LEDs

into groups.

One thing i havent done yet is come up with a general formula for this

new type of multiplexing but it's not hard to understand once

you see the schematic and a very rough description.

I'll start looking and get back here, unless someone else can find

a link before then.

Here is a drawing, from memory, of the traditional way of

Charlieplexing vs true three state multiplexing. As shown,

Charlieplexing only allows one LED to be turned on at a

time, while with true three state multiplexing more than one

LED can be turned on at any given time. For the simple

example shown, turning any two LEDs on at a time means

raising the duty cycle by a factor of 2, which increases average

current by a factor of 2, which is significant. This has

even more of an impact with larger displays, and i hope i

can find that better drawing as the turn on pattern technique

is much more obvious than it looks at first.

Of particular interest is that the duty cycle for Charlieplexing

is 1/12 of the total scan time, while for turning two LEDs on

at any given time the duty cycle for any LED is 1/6, which is

better.

If i remember right, a 100 LED matrix can be done with a duty

cycle of 20 percent per LED, which is MUCH better than only

1 percent per LED with traditional Charlieplexing. This means

that with Charlie the average current through any LED would

be Ipeak/100 which would be roughly 1ma per LED (not a lot!)

but with true three state multiplexing would be 100/5=20ma,

which is very good for most small LEDs. This clearly illustrates

the huge impact this can have on a display.

The disadvantage of course is that more resistors are required,

and a few more control lines might also be needed in some cases

in order to divide the LEDs up properly for correct scanning.

In this drawing, the black L is a constant low, never turned off,

and the red H is a high that turns the red LED on constantly.

The blue H is a high that turns on the blue LED, and the

green L is a low that turns on the green LED. For that line

#3 the choice is to either apply a low or a high depending

on what other LED is to be turned on. Driving line 1 is

similar.