Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Multiplexing 8x40 LED Matrix Without Shift Register or Transistors

Status
Not open for further replies.

rocket100

Member
Hello!

So I was wondering if it would be possible to multiplex an 8x40 LED matrix display without using any shift registers or transistors, just straight from the AVR's I/O pins to the display. I was thinking I could output one 8 bit column since I know my AVR can handle eight LEDs at a time, then move down the matrix for each column (all 40 of them). Would there be a brightness issue here? Would the LEDs be at a 1/40th duty cycle since one column has to wait for 39 others to light?
 
Because the LEDs are on 1/40 of the time you will need to have very high peak current. More than the AVR can handle by about 40 x.

You will need 8+40 IO pins on your AVR.

On the 8 pins bus you will need to drive the LEDs at 20 to 40 times the average current.

On the 40 pin bus each pin will need to handle current for 8 LEDs at a time.

There are other problems but this will give you some thing to think about.
 
Shift registers would make the software a whole lot easier.
It might be possible without, look into 'charlieplexing', I've never done it but I've read up on it, you'd have to structure your software very well and there'd be a fair bit of headscratiching.
 
Hi,

Yes if you have to divide the time up into intervals that are small you have to increase the peak current by the same factor, well that's if the LED had a linear current vs brightness curve, which it doesnt. It usually takes more current than the simple division, but even using the simple division and multiplication method for a linear LED we'd run into the problem of peak current which the LED probably is not even rated for even if you had a big transistor to drive it.

If the uC can turn on up to 10 LEDs during any ONE time segment, then the required current is 10 times the current of one LED. If one LED looks bright with 10ma, then we'd have to have 100ma capability. But that's assuming that the time segment duty cycle is 100 percent, which it never is.
So if we had 20 rows of 10 LEDs where we turn on 10 during any given time segment, that means the average current to one LED decreases by 20 times, or 1/20 of the current we had with 100 percent duty cycle. So to get the same brightness we'd have to pump the peak current up by a factor of 20, which brings us to 2 amperes. Each LED would be getting 200ma peak, which is already too much for the little guys (assuming a 20ma LED). Going to 40 LED rows we'd have to pump up to 4 amps, with 400ma peak in each LED. That's way too much unless we are using high power LEDs but then we'd want even more current for those.

So now you see the problem. The more scan lines to be done the less time each one can get. This leads to using more pins of the uC so that we can split the rows up into groups, or even going to what is sometimes called "CharliePlexing". That's where the LEDs can wired in anti parallel and driven using a somewhat different routine.
However, it's still going to take some higher than usual peak currents. This is where the extra pins come in.

You might be able to get away with a pin extender IC which is nothing more than a chip that is driven serially from the uC and provides programmable I/O pins. This effectively gives you a lot more io pins to work with. The circuit board layout wont be that much more complex however because the only input to this chip would be a clock and a data line which only means two uC pins.
 
The o/p didnt want to use shift reg's, however from your comments al its not gonna be practical.
If its just 'shift registers' that you dont want to use such as the likes of a 4094, then theres another device which I've used to multiplex displays, the very common 4017 decade counter, you could series up a few of these to drive your columns with fets or trannys, you'd only need 2 pins clk and reset.
 
You may be better off driving the LEDs as 4 separate 8x10 arrays (treated like a 32x10 array). Then you can have 32 LEDs lit at once instead of 8, cutting your peak current requirement by 1/4, since you can run the LEDs at a 10% duty cycle instead of 2.5%. This will require only 42 I/O pins as opposed to 48 in your design. Plus you can control the columns with a 4017 decade counter and save 8 I/O pins. You'll need transistors to drive the columns at least, as the micro or 4017 won't have enough current drive capability through a single pin for 32 LEDs at once.
 
Last edited:
The 4017 ring counter is a great idea.

8*40=320 LEDs

320*10mA=3200mA=3.2A

When all the LEDs are on you could draw 3.2 amps. or When some of the LEDs are on the peak current will be at 3.2A. This is very much above the fuse rating on the power and ground leads on a AVR.

SO:
1)You need to use external transistors or power drivers.
2)You need to use external ICs to get the pin count on the micro down.
3)The duty cycle on the LEDs is typically 8:1 or 10:1 but not 40:1.
 
Okay, this is getting way too complicated for me to understand. I am just going to use shift registers to control the whole thing. So, do I just simply put more current into the shift registers to make up for the lost brightness due to the multiplexing? Would I be right to use one 8 bit shift register to source output on the rows, then have eight, 8 bit shift registers along the columns to sink the current? Thanks!
 
Yes you need to push the current up.
You can make a (8*8) and use that 5 times.

Attached is a data sheet for a part that combines a shift register + latch + 100mA driver. The great advantage of using a SR + latch is that while the data is being shifted in the LEDs do not see the shifting data. Using 10mA LEDs in a 8x or 10x multiplex mode requires a 100mA driver. This part only pulls down!
 
Have a look at the MAX7221. This was designed by Charlie Allen who is the founder of Charlieplexing. it is designed for this specific task and as the posts above say, it takes a whole lot of headaches out of the design
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top