SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By muntron
#49560
arader wrote: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?
No, if only 1/8th of the LED rows are lit at a time, your current calculation is correct at 1.6A. This does however mean that your LEDs will be 1/8th as bright, since only 25/8 or about 3 mA average current is available.
By arader
#49762
ok, completed the first schematic: http://i25.tinypic.com/2qiwymv.png

This is my first major schematic, so I'd be eternally grateful to anyone that could give it a quick look for issues. I'm confident the pin connections are correct, what I'm not sure on is powering the AVR and the ISP programming pins. What value should I use for C2? what types of caps are these? Am I missing any other essential capacitors? will I be able to debug the avr using debugWire? etc :)

edit: I should note that the 4 SPI Headers will be disconnected during programming, so I shouldn't have any issues with ISP sharing the SPI pins.
User avatar
By bigglez
#49773
Greetings Andrew,
arader wrote: This is my first major schematic, so I'd be eternally grateful to anyone that could give it a quick look for issues.
Not bad for a first attempt!
arader wrote: What value should I use for C2?
Adding more decoupling capacitors would be wise - the LED
array will draw fast rise pulses of current, and the Vcc line
will sag (more so if you daisy chain these modules).
Add at least three capacitors, good quality electrolytics are
cheap and work well. You do not need the dual capacitor
arrangement you have drawn.
arader wrote:what types of caps are these?
I use 10uF/10V Panasonic ES types, but they are very generic.
arader wrote:Am I missing any other essential capacitors?
Probably not.
arader wrote:will I be able to debug the avr using debugWire? etc :)
As I don't know what debugWire is I can't comment.

Of greater concern is the LED drivers. I found the data sheet
for an LEDMS88R The max pulse current per LED is 100mA, so with an 8:1 MUX
you'll only get 12.5mA per LED, which is good. (As long as the
drivers can source this much current).

Is there a typo? Did you mean 74HC595? The 75HC595 doesn't
exist at TI or ST (the two largest suppliers of 74HC595).

As drawn it's the column high-side driver, and an HC series
part has only 6mA per pin max current, and 50mA max per
ground or supply pin. Your design requires 100mA to match
the low-side driver. Most (if not all) commercial LED matrix
drivers use discrete devices for the high-side driver role.

The two SRs can be daisy chained together (saves an IO
pin), and send 16 bits in a burst, then clock the latches.

Depending upon the performance of the High-side and low-side
drivers, it's possibly to have unintended ghosting. The drivers
need a small dead-time to stop overlap of the drive signals.

Finally, a Tiny26 AVR only has 2kB prog EEPROM, 128B RAM,
and 128B EEPROM space. This will not be sufficient for even
a modest ASCII font set. Either use a larger AVR, or add
some I2C EEPROM on the PCB to store LUTs, (or both).

Comments Welcome!
By arader
#49785
bigglez wrote:Adding more decoupling capacitors would be wise - the LED array will draw fast rise pulses of current, and the Vcc line
will sag (more so if you daisy chain these modules).
Add at least three capacitors, good quality electrolytics are
cheap and work well. You do not need the dual capacitor
arrangement you have drawn.
Thanks for the advice, but what do you mean by not needing the dual capacitor arrangement, but that I should add more decoupling capacitors? Do you just mean I can get rid of C2, but that I should add more caps elsewhere? Where would I need them most?
bigglez wrote:Of greater concern is the LED drivers. I found the data sheet for an LEDMS88R The max pulse current per LED is 100mA, so with an 8:1 MUX you'll only get 12.5mA per LED, which is good. (As long as the drivers can source this much current).
When does pulse current come in to play? Is this just the max amount of current I can supply in short bursts?
bigglez wrote:Is there a typo? Did you mean 74HC595? The 75HC595 doesn't exist at TI or ST (the two largest suppliers of 74HC595).
yep, that's a typo :oops: should be 74HC595
bigglez wrote:As drawn it's the column high-side driver, and an HC seriespart has only 6mA per pin max current, and 50mA max per
ground or supply pin. Your design requires 100mA to match
the low-side driver. Most (if not all) commercial LED matrix
drivers use discrete devices for the high-side driver role.
first, when you say high/low side driver, your talking about the 74HC595 attached to either anode or cathode respectively, yes? I share your concern for the high-side driver, and this is what I have been thinking so far: Since I'll be switching through the rows 1 at a time, the high side driver (column driver) will only have to power 1 led per output. I'll be using TI's 74HC595: http://focus.ti.com/lit/ds/symlink/sn74hc595.pdf Looking at page 5 it states "Continuous output current, IO (VO = 0 to VCC)" ±35 mA". So this should work, yes? also, looking at sparkfun's serial backpack they used the similar 74LS595s: http://www.sparkfun.com/datasheets/Comp ... ematic.pdf
bigglez wrote:Finally, a Tiny26 AVR only has 2kB prog EEPROM, 128B RAM, and 128B EEPROM space. This will not be sufficient for even
a modest ASCII font set. Either use a larger AVR, or add some I2C EEPROM on the PCB to store LUTs, (or both).
You're right, but I don't plan on loading the fonts into the avr ;)

thanks a ton!
User avatar
By bigglez
#49789
Greetings Andy/Andrew,
arader wrote: what do you mean by not needing the dual capacitor arrangement, but that I should add more decoupling capacitors? Do you just mean I can get rid of C2, but that I should add more caps elsewhere? Where would I need them most?
Your diagram shows two caps in parallel and close together.
One larger in capacitance. This arrangement is popular in
wide-band analog circuits where the small ceramic cap
operates on high frequency, because the large electrolytic
is assumed to have poor HF performance. This is old school
but valid. Improvements have been made in electrolytics
and with much lower voltage supplies (hence physically
smaller) they operate well up to HF.

Going further, the caps should be spread around the PCB,
and associated with the ICs that draw most current. The
caps serve as a local supply of current, and counter the
effects of long PCB runs or wiring (which you will certainly
have with daisy chained modules).

Place one small footprint electrolytic cap at the power
and/or ground pin of each IC, well at least the AVR and
the high-side and low-side drivers. That's three caps.
You can always remove them after the proto works -
adding extra caps (if needed) is a pain.
arader wrote: When does pulse current come in to play? Is this just the max amount of current I can supply in short bursts?
Yes. Which will be much of the time in a MUX'd LED driver.
The high-side and low-side drivers will take gulps of current,
with little or no restriction at each transistion. Even if the
MUX is cycling at a few hundred hertz (to stop flicker) the
edge speed will be micro-seconds (or faster) causing EMI
in the megahertz range, which could couple into the AVR
or corrupt data in the daisy-chain.
arader wrote: yep, that's a typo :oops: should be 74HC595.
Then it's pushing the limits. The HC family is not intended for
sourcing much current. The spec is 6 to 8mA per output.
Here's an important article on the twenty or so different sub-familiesof logic.

The AC and ACT family is superior as it can source 24mA, but
you need equality with the low side driver and ability to hit
the 100mA peak of the LED matrix.

This is my position, others will disagree. I believe if you drive
the LED to the max allowed you can always back down (with
either PWM or larger ballast resistors). BUT design it too weak
and you are stuck with a dim display (which might be good
for a bedroom clock but not for a daylight readable sign).
arader wrote: first, when you say high/low side driver, your talking about the 74HC595 attached to either anode or cathode respectively, yes? I share your concern for the high-side driver, and this is what I have been thinking so far: Since I'll be switching through the rows 1 at a time, the high side driver (column driver) will only have to power 1 led per output.
In your scheme how many LEDs could be lit at any moment?
I think it's eight (a whole row or column - the labels are just
semantics - the matrix is square). If you think it's only one
LED, then pulse current has to be eight time higher,
and the pulse limit on the LED is 100mA, so the average
per LED is now just 100/64 or 1.6mA (not enough).
arader wrote:I'll be using TI's 74HC595 Looking at page 5 it states "Continuous output current, IO (VO = 0 to VCC)" ±35 mA". So this should work, yes? also, looking at sparkfun's serial backpack they used the similar 74LS595s: http://www.sparkfun.com/datasheets/Comp ... ematic.pdf
You are reading the Absolute MAX ratings and applying
them to typical operation. It may work, it may not. It may
work today but not tomorrow... The typ ratings for that part
are only six milliamps per output!

For the low side driver consider the power logic version
TPIC6C596N, which has 100mA per output.

I happen to be constructing a display at the moment
that uses six, five by seven LED, matrices. I have the
prototype working with 10mA average LED current,
and 50mA peak current (it scans in blocks of five, not
eight as you have). Let me know if you'd like to see
the schematic and/or PIX of the hardware.

Comments Welcome!
By arader
#49804
bigglez wrote:Place one small footprint electrolytic cap at the power
and/or ground pin of each IC, well at least the AVR and
the high-side and low-side drivers. That's three caps.
You can always remove them after the proto works -
adding extra caps (if needed) is a pain.
makes sense, thanks :)
bigglez wrote:This is my position, others will disagree. I believe if you drive
the LED to the max allowed you can always back down (with
either PWM or larger ballast resistors). BUT design it too weak
and you are stuck with a dim display (which might be good
for a bedroom clock but not for a daylight readable sign).
I completely agree with you. I may not need max brightness, but it would be nice to have it available
bigglez wrote:In your scheme how many LEDs could be lit at any moment?
the max that could be lit at any moment is 8
bigglez wrote:If you think it's only one
LED, then pulse current has to be eight time higher,
and the pulse limit on the LED is 100mA, so the average
per LED is now just 100/64 or 1.6mA (not enough).
could you clarify this? how did you get 8 times higher etc?

so to re-cap for my understanding (and to make sure I'm following) I need to match the max pulse current in both the high-side and the low-side drivers.

thanks a ton bigglez :D
By arader
#49819
bigglez wrote:For the low side driver consider the power logic version
TPIC6C596N, which has 100mA per output.
Would the TPIC6B596 be even better then? it has 150ma per output, so I'd have some room. Also, either one would mean I can remove the ULN2803A from my circuit, right?

So if the TPICs act as current drains, it means I can only have them as low-side drivers, right? What should I use for the high-side then?

thanks!
User avatar
By bigglez
#49821
Greetings Andy,
arader wrote:
bigglez wrote:In your scheme how many LEDs could be lit at any moment?
the max that could be lit at any moment is 8
.....
could you clarify this? how did you get 8 times higher etc?
.....
I need to match the max pulse current in both the high-side and the low-side drivers.
The LEDs are time-division-multiplexed (MUX'd), so at any
instant in time between zero and eight are lit. To give each
LED the same brightness they share the time equally. There
are eight sets of eight LEDs, and when all 64 LEDs have
been serviced we start over. The time period to do this
is called a Frame.

During the frame each LED (of the eight in that set) needs
eight times the average target current to have the same
power (brightness) as a similar LED running from DC.

Given the limit of 100mA peak for the LEDs, the 1/8
average value is 12.5mA. In testing I've found 10mA
to be plenty of current, but to maximize the options
we shoot for 12.5mA.

Each LED Anode is connected to a positive voltage in
turn, by the high-side driver. Each LED Cathode is
connected to ground in turn, by the low-side driver.
Only LEDs that are turned on have both high and low
switches closed. Each switch channel (both high and
low side) must carry eight times the LED average
current, or 100mA peak.

The max LED current is limited (controlled) by either a
ballast resistor or a current limited driver. The MAX7219
(that I used on a previous project) has internal limiting
so all the LED resistors are removed.

Here the current limit requires a resistor per either
high or low side driver, as the matrix is square and
each IO pin on the LED serves eight internal LEDs.

The low side switches are easy (due to semiconductor
physics beyond this discussion). The high side
drivers are not as easy, require more parts, cost
more (use more silicon) and are less available as
IC units. I brewed my own driver using descrete
P-ch Fets as I could not find a commercial IC part.

I hope this sheds some light on the LED driver problem.

Comments Welcome!
Last edited by bigglez on Sat Jun 07, 2008 10:35 am, edited 1 time in total.
User avatar
By bigglez
#49823
Greetings Andy,
arader wrote:
bigglez wrote:For the low side driver consider the power logic version
TPIC6C596N, which has 100mA per output.
Would the TPIC6B596 be even better then? it has 150ma per output, so I'd have some room. Also, either one would mean I can remove the ULN2803A from my circuit, right?

So if the TPICs act as current drains, it means I can only have them as low-side drivers, right? What should I use for the high-side then?
I missed this message while answered your last one.
While the TPICB596 has more power ability, you can't use
the extra current due to the spec limit of 100mA on the LEDs.
Also, the 'B' is a 20 pin package compared to the 'C' 16pin.
Here's the summary page from Texas Instruments.

The ULN2083A can go away. I use descrete P-ch Fets driven
by another TPIC6B596 and one more resistor per Fet. Very simple.

Comments Welcome!
By arader
#49837
awesome, I'll remove the ULN2803 and replace the low-side 74HC595 with a TPIC6C596N. I'll then need 8 mosfets, each one with a current rating of 12.5mA, yes? Is there a way I can get these in a dense package? I don't have a lot of board space to work with :)

Also, are the resistors I have attached to the columns fine?

thanks!
By arader
#49858
wait, actually I just confused myself. If each channel on both the high/low side must be able to handle 100ma, why would I need mosfets? couldn't I just use the TPIC6C596s for both the high and the low sides?

edit: nevermind, I forgot they only sink 100ma, not source it. Anyway, is there a shift register that can source 100ma? I'd love to not have to try and squeeze 8 transistors on my pcb :)

edit 2: I found this on mouser: http://www.mouser.com/Search/ProductDet ... Wa7A%3d%3d (datasheet: http://www.diodes.com/datasheets/ds30304.pdf) It's a dual NPN transistor each having a collector current of 50mA. This would be fine, right?
User avatar
By bigglez
#49877
Greetings Andy,
arader wrote:Anyway, is there a shift register that can source 100ma? I'd love to not have to try and squeeze 8 transistors on my pcb :)
If there is I haven't found it....
arader wrote:I found this on mouser: http://www.mouser.com/Search/ProductDet ... Wa7A%3d%3d (datasheet: http://www.diodes.com/datasheets/ds30304.pdf) It's a dual NPN transistor each having a collector current of 50mA. This would be fine, right?
No. Abs Max spec. << Your Design spec.
In general, FETs will be more efficient than bipolar as
we are interested in the saturated switching power loss.


My current prototype (through hole, no PCB) uses the
FQP27P06 P-ch Fet I had on hand (27A, 60V, 70mR, TO220).
Obviously overkill!

For a PCB version of this project I will switch to a dual
P-Ch in SOT6 (SMT), FDC6306PCT.
Or, a single P-Ch in SMT such as NDT2955
(2.5A, 60V, 300mR, SOT-223).

If you are stuck with TH assembly, consider the TO-92
single FET, such as BS250KL-TR1 (270mA, 60V, 10R, To-92)
Scattering eight over the PCB would be no more difficult
than converging eight channels to single package (if
one existed).

Comments Welcome!
By arader
#49930
ok, here's the updated schematic: http://i32.tinypic.com/b8nsea.png

I added 2 capacitors, 1 for the low side and 1 for the high side drivers.

I added 4 FDC6306PCT mosfets. Do I have them hooked up correctly? The 8 outputs of the 8bit shift register (a 74AHC595) connect to each mosfet's gate pin. I then have each mosfet's source pin wired to +5V, and the drain pins wired to the columns of the LED matrix through a 100Ohm resistor.

Each row of the led matrix is connected to the TPIC6C595.

do these changes look good? anything else I need or am I ready to work on the board's design?

oh, one last thing: what should I do with any pins not used (for example, the serial out pins of the shift registers). Can I just leave them disconnected?
User avatar
By bigglez
#49937
Greetings Andy,
arader wrote: ok, here's the updated schematic:
I added 2 capacitors, 1 for the low side and 1 for the high side drivers.
I added 4 FDC6306PCT mosfets. Do I have them hooked up correctly?
.....
LED matrix through a 100Ohm resistor.
Everything does look good, two errors should be addressed:
(1) The LED ballast resistors (100 ohms) will only yield
27mA peak for the LEDs. A value of 15 ohms will put
you at 106mA peak (desired).

I have Spiced the circuit using the values of the components
you have now choosen.

(2) The caps should be much larger, I'd use 10uF, and
add another one of 47uF close to the DC power input.
(This is my standard arrangement, others may have
different suggestions. A lot varies with the length of the
power supply wiring and it's performance).
arader wrote:oh, one last thing: what should I do with any pins not used (for example, the serial out pins of the shift registers). Can I just leave them disconnected?
You can return the Ser Out to an unused pin on the uC (if
you have extra pins) to read back the SR Data. This
option is useful when the module is build in to an unknown
array and the firmware needs to discover the array size.
In your case this feature is limited to the eight LEDs in
X and Y, but foir larger arrays it's useful.

Or, you can ignore those pins, they don't require any
further connections.

Final note while I remember to pass it along, the new
FETs invert the data, so to turn on the high-side switch
you need a low logic at the SR output. The low-side
also inverts so you need a high logic to turn on the
TPIC output's FET, which in turn pulls the LED low.

Comments Welcome!
By arader
#49941
bigglez wrote:(1) The LED ballast resistors (100 ohms) will only yield
27mA peak for the LEDs. A value of 15 ohms will put
you at 106mA peak (desired).
Thanks Peter! quick question though: how did you calculate these numbers? I would have thought at 100 ohms I'd have I = 5v / 100ohms = 50mA (still not enough however).
bigglez wrote:(2) The caps should be much larger, I'd use 10uF, and
add another one of 47uF close to the DC power input.
(This is my standard arrangement, others may have
different suggestions. A lot varies with the length of the
power supply wiring and it's performance).
Will do :)

also, I've noticed the led matrix datasheet states "Forward Voltage: 1.80 - 2.20V". Will I need to worry about using a 5V supply? or will the MOSFETs / Shift Registers take care of that?