SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By arader
#49363
Hi all,

I'm kicking around the idea of creating a 64x64 led matrix using smaller 8x8 led matrices. My plan is to use shift registers and darlington arrays in order to control the matrix.

My design is such that I'll loop through the rows tying them to ground, and then I'll supply current to the correct columns in that row. This way at any given moment in time I'll have at most 64 leds lit (this would be when an entire row is lit)

Here's my first round of questions :)

1) I'm looking at using ULN2803A darlington arrays to act as the current sinks for each row. Every 16 leds in a row would be on its own darlington array (meaning I'd need 4 per row, 32 chips total). I decided on this configuration because each output of the array supports up to 500ma, assuming each led is around 25ma, 16 * 25 = 400ma. Is this a safe assumption / design? Is there any way I can lower this number?

2) I'm also looking at using the 74HC595 shift registers to control the rows / columns. The 74HC595 is an 8bit serial shift register, meaning I'd need 8 for the rows and 8 for the columns (16 total). For the rows, I'd be shifting just 1 bit at a time going from row 0 to row 63. For the columns I'd be clocking in the correct string of bits for the currently enabled row. Each 74HC595 that is tied to a row will be going through the darlington arrays, so the current output doesn't really matter. However, for the columns, since only one row will be tied to ground, only 1 led will be driven by each output of the shift registers. Does this mean I'll be safe with the 74HC595's output of ~25ma per output? or will I need darlington arrays for the columns as well?

Let me know if any of this is confusing, as I'd love to get started as quickly as possible. My ultimate plan is to get this using bluetooth as a data transfer medium, and hopefully get it displaying some simple images/video soon :)

thanks!
By macegr
#49364
Sounds fine except for the 1/64 multiplexing. That will end up being too dim or too flickery. Try for 1/8 multiplexing at the most, this means you now have to have 8 * 64 column drivers, and 64 row drivers.
By arader
#49365
thanks for the reply :) how dim is dim? if each row is lit only 1/64th of the time, I assume it will be around 1/64th as bright? will this be too dim for an indoors only display? will changing the refresh rate effect brightness? (I was planning on 60 frames per second)

I'd also like to be able to apply some form of software PWM to the leds. If I wanted an 8bit pwm (255 levels) I could iterate over the rows 255 times per frame. This would obviously require more speed / processing power, but it would mean I'd have a nice monochrome display.

thanks!

edit: oh, and doing 1/8th multiplexing would mean 64 + 8 = 72 74HC595 ICs! are there any shift registers greater than 8 bits? a 32 bit or even 64 bit shift register would be perfect. Not only is 72 shift registers a lot of hardware, but I would need multiple microcontrollers to control them.
By Philba
#49371
Actually, you will only need one micro to control the 64 SRs you need. You can chain them together into a 512 bit shift register. The good news is that SRs are dirt cheap. The ON Semi 74HC595 is $.144 in quantity 100 from Mouser. All you will need is 3 output pins. For the row select, I'd use a 74HC138 so only 3 pins for that.

The only concern I have is how long it will take to clock all 512 bits through the SR chain. Use a micro with a hardware SPI controller.

Since you sound a bit inexperienced, I would start with 8 leds and 1 sr. learn how to work that. Then graduate to an 8x8 matrix. Then try 16x8. Do it using interrupts. By then, you should be able to go to 64x64 (which is really 512x8).
By arader
#49374
thanks Philba :)

yes I am a bit inexperienced, I'm just a software guy looking for a hobby :) I was hoping that I would be able to save some complexity / parts by going big, but I think you're right. What I'll probably do is create a backpack for each 8x8 matrix, 1 backpack will be a master, and the others will be slaves that can be daisy chained. This way I can start small but work up as big as I need to :)

side question - what would be a good way to get data to slaves? I'd like to be able to add slaves without having to re-flash the master, and it would also be nice to be able to add any number of slaves without any speed issues. I don't think SPI would work, since I'd have to add code + select lines for each slave added... thoughts?
User avatar
By bigglez
#49375
Greetings (No First name Supplied),
arader wrote: I'm kicking around the idea of creating a 64x64 led matrix using smaller 8x8 led matrices. My plan is to use shift registers and darlington arrays in order to control the matrix.
I see that you already have a couple of solid replies
to your request. I'm wondering if you have read the
previous threads on Matrix displays?

Giant programmable LED matrix 'poster' ...is back

Need Help with a project, Long Length Scrolling Matrix

LED Matrix "Message Board" Backpack Design

MAX7219 EVAL PCB

These will get you started, and you can refine your
questions (to save reinventing the wheel).

Comments Welcome!
By Philba
#49384
Having a software background gets you a long way. Just resist the temptation to use large system solutions to these micros. I have a deep background in systems software and it took a while for me to "think small".

I think you will find that a multiprocessor solution to be complex - especially debugging. If you really want to go down that path try I2C. It really was designed for this so of thing and you can find inexpensive micros with good support. Even using SPI, I think you will find that that it's fairly easy to generalize - you will need a discovery protocol.

I still think a long chain of SRs will actually be your best approach but it's your project. Do read the other threads, there's lots of good info there.
By muntron
#49397
Philba wrote:I still think a long chain of SRs will actually be your best approach but it's your project. Do read the other threads, there's lots of good info there.
I tend to agree, but don't forget that SPI can be treated as a chain of SRs. I do think that you should try to limit the length of the chain. Your idea of a backpack controlling each 8x8 display has been implemented successfully by others and has some advantages. In particular, modularity. If your final intention is a 64x64 display, there may be other configurations. For example, one might multiplex 8 rows of 64 bits at a time, thus reducing the duty cycle. The downside is the need for more SRs. Since you are a software person, you might prefer to reduce the H/W complexity in favor of additional S/W.

I would also suggest that 255 levels may be too many. Start with 16, try to go up from there.
By Philba
#49406
the problem with assembling a bunch of 8x8 modules into a 64x64 array is that you gain somewhat in hw simplicity, but you lose a lot more in software complexity. running a chain of 64 SRs is pretty simple and efficient. the '595 can run well north of a megahertz and a PIC with hw SPI can easily drive them at that rate.

By the way, you can make the SR chains pretty modular. In fact, I built a POV wand that you could add an unlimited number of 8 LED modules, each based on a '595.
By arader
#49458
thanks for the replies guys :)

I'm going to have to give it some more thought (obviously) so for now I'm planning on just creating 1 backpack for one of the 8x8 matrices. We'll see how it goes from there.

one quick question however: with SPI, is it possible / allowed to enable the slave select line on more than one slave? I'm just thinking of ways to implement a sort of "broadcast" to a bunch of slaves.
By Philba
#49460
slave broadcast?
Sure that is possible to do. Though, it does mean that might not be able to use a demux to save on pin counts.
User avatar
By bigglez
#49472
Greetings (Still No First Name),
arader wrote: I'm going to have to give it some more thought (obviously) so for now I'm planning on just creating 1 backpack for one of the 8x8 matrices. We'll see how it goes from there.

one quick question however: with SPI, is it possible / allowed to enable the slave select line on more than one slave? I'm just thinking of ways to implement a sort of "broadcast" to a bunch of slaves.
A technique that I use is to loop the last SR output back
to the uC. That way a discovery subroutine can clock
out a single data bit and count the clocks before it
comes back (at the end of the SR). Now the main
program knows how long the SR is, and therefore
the matrix size.

Another hint. If you double buffer the SRs, you can
load the next data without blanking the display. This
is very useful to keep the display duty-cycle up.

There are double buffered SRs and also power logic
SRs that can eliminate the transistor stages required
to get enough LED current.

If you haven't already done so, please post the
part number of the LEDs that you plan to use. We'll
need the data sheet info to determine the min
duty-cycle (max SR length) for each module.

What is your first name?

Comments Welcome!
By Philba
#49486
the power SRs - TPIC6C595 are a good choice. Jameco has the best prices on them. Be aware that they are low side drivers which means they can only sink current, not source it. This means your row drivers need to be high side.

Also, you need to do current and power calculations for your drivers. at 512 LEDs/row, you will probably need a fair amount of current drive. Don't forget the 1/8 duty cycle in your calcs.
By gmarsh
#49496
A few personal notes to help/simplify your design.

I had a 120x7 scrolling LED sign which had a blown controller, so I designed a new controller for it. To make it work, I first treated the sign like a 128x8 panel, then refreshed it as a 32x32 array. If you want a decently bright display, don't do more than 32 rows.

The hardware was ridiculously simple. I used eight STP08C596 8-bit current sink shift registers from ST. Four of the chips drove the 32 column lines directly, and four of the chips drove an array of 32 PNP transistors (sinking current directly out of the bases, no resistors) which in turn drove the 32 row lines.

I used an ATMega168 microcontroller running off its own 8MHz oscillator to drive the shift registers using its SPI interface. The only other hardware on the board was a MAX232 for a RS232 interface. The whole thing ran off a 5V/4A wall wart.


The same design should work for a 64x64 display. You'll want to drive it as a 128x32 array or it'll be too dim.

ST no longer makes the STP08C596, but they make the STP16DP05 which is a 16-channel, 100mA shift register. You'll need 8 of these chips. Use the HTSSOP package with the thermal pad if you can.

Next you'll have to pick row drivers. These have to handle 100mA * 128 = 12.8A peak, divide that by 32 for a 400mA average current. 12.8A peak may push a PNP into secondary breakdown, so this will probably be a FET.

Something like a Fairchild FDS6975 (dual P-ch in an 8-pin SOIC) will work well. To drive these, use four 74HC595 shift registers (on the same shift register chain as the STP16's) to drive the gates directly through resistors.

Finally, a 64x64 LED array requires 512 bytes of display memory, which is half of an ATMega168. You'll probably want to use something like a Mega328P microcontroller in this case.

That should be enough for now. Any questions, just ask.
By arader
#49554
bigglez wrote:please post the
part number of the LEDs that you plan to use.
I'll be using the module found here: http://www.futurlec.com/LED/LEDMS88R.shtml - The forward current for each LED is 25ma.
bigglez wrote:What is your first name?
Andy :)
Philba wrote:the power SRs - TPIC6C595 are a good choice.
Are you suggesting these replace the 74HC595 SRs? it appears the TPIC6C595s only go up to 250ma, but if I couple my 74HC595 with the ULN2803A transistor array I'd have up to 500ma. At 8 leds per row * 25ma each I'd be at 200ma, which is pretty close to 250 but a ways away from 500. The only thing I'm worried about is the column's SR. The datasheet (http://focus.ti.com/lit/ds/symlink/sn74hc595.pdf) has the following:
Code: Select all
Input clamp current, IIK (VI < 0 or VI > VCC) (see Note 1)  . . . . . . . . . . ±20 mA
Output clamp current, IOK (VO < 0 or VO > VCC) (see Note 1) . . . . . . . . . . ±20 mA
Continuous output current, IO (VO = 0 to VCC) . . . . . . . . . . . . . . . . . ±35 mA
Continuous current through VCC or GND . . . . . . . . . . . . . . . . . . . . . ±70 mA
Since the column will be driving the LEDs, is it the output current (35ma) that I'm looking at? If so, then I should be fine, right?
Philba wrote:Also, you need to do current and power calculations for your drivers. at 512 LEDs/row, you will probably need a fair amount of current drive. Don't forget the 1/8 duty cycle in your calcs.
I'm definitely trying to get the calculations right the first time, but I should remind you it's 64 LEDs/row total, not 512. I'll be hoping for an 8x8 matrix of 8x8 matricies (for 64x64 total leds).

so for a row of 64 LEDs, that would mean I need to supply 64 * 25ma = 1.6A - but what do you mean by the 1/8 duty cycle? do you just mean to say that every 8 rows will actually be powered, so really the calculation is 8 * 64 * 25ma = 12.8A?
gmarsh wrote:If you want a decently bright display, don't do more than 32 rows.
I take it this really means shouldn't have more than a 1/32 duty cycle, right?

seriously, thanks for the awesome help so far guys :) I'll be posting my schematic thus far shortly. This will be my first "off the dev board" design, so I'll definitely need some help in design the power supply for this.