SparkFun Forums 

Where electronics enthusiasts find answers.

Questions relating to designing PCBs
By Vraz
#42277
So I just clued in that you are trying to drive the SFE dual-color matrix display. That answers why you drive 8 LEDs at a time but have 16 current limiting resistors (2 colors). However, the big issue is that when you drive a single row of 8 LEDs, all the current will return on a single column pin. So while each LED might draw 9ma, with them all on, you need to return 72ma on a single pin.

That 72ma will exceed the single pin rating of the AVR or of the 595 (35ma per pin). You need something with higher current capability than either of these parts for the column select.

Just curious-- you have tried the matrix with the 330 ohm current limiting resistor @ 5v and was it bright enough for your application? Obviously more current creates additional challenges, but better to figure out exactly what you need now so you can correctly size the other components.
By Random
#42278
Vraz wrote:So I just clued in that you are trying to drive the SFE dual-color matrix display. That answers why you drive 8 LEDs at a time but have 16 current limiting resistors (2 colors). However, the big issue is that when you drive a single row of 8 LEDs, all the current will return on a single column pin. So while each LED might draw 9ma, with them all on, you need to return 72ma on a single pin.

That 72ma will exceed the single pin rating of the AVR or of the 595 (35ma per pin). You need something with higher current capability than either of these parts for the column select.

Just curious-- you have tried the matrix with the 330 ohm current limiting resistor @ 5v and was it bright enough for your application? Obviously more current creates additional challenges, but better to figure out exactly what you need now so you can correctly size the other components.
That's interesting - I am running it right now with the 3 shift registers and 330 ohm resistors, and it's working fine on a breadboard (while not very bright, it's perfectly sufficient, I wouldn't want it brighter). I believe the SparkFun serial control backpack also uses the same shift registers without problem.

I see your point about the 72mA returning on one pin, though.
Bear in mind that each LED is being driven at less than 6% duty cycle - on half of 1/8th of the time, when it's on - and it's not being updated all the time, but instead once every 200µs.
I don't know if this might change the effective current, since it does seem to be working fine at the moment.
By muntron
#42282
Random wrote: That's interesting - I am running it right now with the 3 shift registers and 330 ohm resistors, and it's working fine on a breadboard (while not very bright, it's perfectly sufficient, I wouldn't want it brighter). I believe the SparkFun serial control backpack also uses the same shift registers without problem.

I see your point about the 72mA returning on one pin, though.
Bear in mind that each LED is being driven at less than 6% duty cycle - on half of 1/8th of the time, when it's on - and it's not being updated all the time, but instead once every 200µs.
I don't know if this might change the effective current, since it does seem to be working fine at the moment.
If you breadboard is still attached, you might try an experiment. Set up the display with one LET lit on the first row, two on the second, etc. with 8 on the bottom. Can you see any difference in the brightness of the rows?
User avatar
By bigglez
#42286
Greetings Adam,
random wrote:I believe the SparkFun serial control backpack also uses the same shift registers without problem.
Correct, but only for Columns, the Rows are driven
by low-side drivers spec'd to 500mA (ULN2003,I
think, the number was left off the SFE schematic).

Comments Welcome!
User avatar
By bigglez
#42287
Greetings vraz,
Vraz wrote: For the 164P, I assuming the graphs you are referring to are 28-22 and 28-22. They show voltage drop based on pin load, capping out at 20ma per the above spec.
It was late when I posted the datasheet cite, and to clarify,
use this datasheetand check fig. 28-22 and 28-23.
Vraz wrote:Note that I assumed this design required no more than 10ma per pin since Random quoted the power consumption at 150ma and I assumed that was divided between the matrix of 16 LEDs (150/16=9.3ma max) in a raster scan.
Not true. The array requires zero to eight columns
to be high at the same time as one row to be low.
The row therefore can have eight times the single
LED current, exceeding the AVR IO pin spec.
Vraz wrote:bigglez- Is there something else I missed or am I reading the spec wrong, or ???
Yes, even though the matrix is MUX'd the drivers must
be strong enough to carry the full current of eight LEDs.

Because of MUX'ing the peak LED current will be eight times
the average current.

In this case the OP is happy with very low brightness
compared to the DC limits of the display, but even so
the current demand exceeds the drivers (in an AVR),
and taxes the drivers in an HC CMOS logic device.

Comments Welcome!
By Random
#42288
muntron wrote: If you breadboard is still attached, you might try an experiment. Set up the display with one LET lit on the first row, two on the second, etc. with 8 on the bottom. Can you see any difference in the brightness of the rows?
I don't notice any difference with any of the letters I've got, so I doubt any difference would be noticed in normal usage. I did try a similar setup a while ago and didn't see any difference in brightness.

bigglez: In that case, do you suggest I keep on using the shift registers? I'd rather not have them suddenly die, but at the same time I don't know that I can fit output drivers on?

Alternatively, would these ([SparkFun] by any more suited? They are larger packages, which might be a pain, but they are also capable of 150mA/channel, 500mA max.

I don't know if all that would physically fit on the board without going to an SMT version of the uC though...
By Vraz
#42290
So I disagree with bigglez--

If you are using 330 ohm current limiting resistors, then you don't need the 595s. The AVR is more than capable of driving the 9ma pin load you are using. SFE uses the 595 because they use 100 ohm current limiting resistors and thus need to drive 30ma, which I agree, is above what the AVR can source.

Neither the AVR nor the 595 are speced to deal with the combined current from 8 LEDs @ 9ma on one pin. Its working with the 595 now because of the 1/8th duty cycle (its not actually 1/16th because the same pin is used for two LED rows). It would probably work with the AVR (for a while) for the same reason. However, who knows what would happen over time and should the program crash and leave one row all on, the drivers in either the AVR or 595 would likely fry.

To handle 8 LEDs at once, you need something like the UNL2003 like SFE used to handle the combined current return (or source, depending on how you wire it). If 9ma per LED works for you, then the AVR 164P plus the URL2003 will drive the circuit-- no 595s required and all within spec.

Alternatively you could do it entirely with the AVR if you limit to driving one LED at a time, but not sure it would look very good.

If you want to drive 8 LEDs at 30ma, then something else like the 595 is required. Not sure I would push the AVR to its max at 20ma either (you would need to split pins between ports), but at 9ma I just don't see an issue.
By Random
#42291
Vraz wrote:So I disagree with bigglez--

If you are using 330 ohm current limiting resistors, then you don't need the 595s. The AVR is more than capable of driving the 9ma pin load you are using. SFE uses the 595 because they use 100 ohm current limiting resistors and thus need to drive 30ma, which I agree, is above what the AVR can source.

Neither the AVR nor the 595 are speced to deal with the combined current from 8 LEDs @ 9ma on one pin. Its working with the 595 now because of the 1/8th duty cycle (its not actually 1/16th because the same pin is used for two LED rows). It would probably work with the AVR (for a while) for the same reason. However, who knows what would happen over time and should the program crash and leave one row all on, the drivers in either the AVR or 595 would likely fry.

To handle 8 LEDs at once, you need something like the UNL2003 like SFE used to handle the combined current return (or source, depending on how you wire it). If 9ma per LED works for you, then the AVR 164P plus the URL2003 will drive the circuit-- no 595s required and all within spec.

Alternatively you could do it entirely with the AVR if you limit to driving one LED at a time, but not sure it would look very good.

If you want to drive 8 LEDs at 30ma, then something else like the 595 is required. Not sure I would push the AVR to its max at 20ma either (you would need to split pins between ports), but at 9ma I just don't see an issue.
I think the main issue is the return cathode - the cathodes are also controlled, so using the shift registers means the cathode register is sinking at most 8*9 = 72mA current on one channel.
By muntron
#42292
Random wrote: I don't notice any difference with any of the letters I've got, so I doubt any difference would be noticed in normal usage. I did try a similar setup a while ago and didn't see any difference in brightness.
Most letters do not light up more than half a row, so if you do not intend on doing graphics, you may be OK.
Alternatively, would these ([SparkFun] by any more suited? They are larger packages, which might be a pain, but they are also capable of 150mA/channel, 500mA max.
For the low side SR these are appropriate. Note that they are still not up to the requirement for the high side. You might be better off using AVR outputs for those.

I do have another question. Are you intending to have multiple 8x8 arrays make up the final display? If you do, you may be better off removing the USB from the backpack and having some master controller for the display. The controller would have the USB and communicate with the backpacks via something like I2C. If one array is you final goal, perhaps you should not limit yourself to the size of the LEDs.
Last edited by muntron on Tue Feb 05, 2008 2:43 pm, edited 1 time in total.
By Random
#42293
I am planning on having just the one LED matrix (for now at least - perhaps a future version will extend this!).

If the high power ones still won't cut the high side, then I guess there's not much point since the normal ones seem to be fine for the low side.
User avatar
By bigglez
#42302
Greetings Adam, et al.,
muntron wrote:
random wrote:Alternatively, would these ([SparkFun] by any more suited? They are larger packages, which might be a pain, but they are also capable of 150mA/channel, 500mA max.
For the low side SR these are appropriate. Note that they are still not up to the requirement for the high side. You might be better off using AVR outputs for those.
The TPIC6C595 is a great chip and available in SOIC.
It does not have push-pull outputs so it can only sink current.
This would make it ideal for a low side driver in a CC
(Common Cathode) display, where it can easily sink
the rated current of eight LEDs at full brightness.

For the companion high side driver the 74HC595 is popular,
but the spec is only 6mA typical per output as a source.
This is a logic to logic interface spec, so a heavier
load can be driven with reduced output voltage at the
pin. The abs. max. spec is 25mA but that number should
never be used for a design typical spec.

Comments Welcome!
By Random
#42303
The LEDs are indeed rated at 2V forward, and at 330ohm that's 6mA - exactly on spec for the 74HC595? (Unless my maths is wrong here...)

As a side thought, though, if the abs. max spec on the shift register is 25mA per channel, and I'm currently driving mine at 8*6=48mA, almost twice the abs. max, where's the magic smoke? I can't believe it'd keep on running at twice its abs max for weeks.
User avatar
By bigglez
#42304
Greetings Adam,
Random wrote:bigglez: In that case, do you suggest I keep on using the shift registers? I'd rather not have them suddenly die, but at the same time I don't know that I can fit output drivers on?
The TPIC6C595 would be my choice for low side drivers
with a CC (Common Cathode) array.

I would strongly consider the 74HC595 for high side
drivers, knowing they are being driven beyond their
guarenteed source current of 6mA, but below their
abs max rating of 25mA.

There aren't a lot of options for high side drivers, so
an alternative design would use 74HC595s or AVR
port pins driving PNP transistors for a CA (Common
Anode) array, with more 74HC595 low side drivers
or even TPIC6C595 which has much stronger outputs.

The key here is that you are satisfied with the current
brightness, as your scheme has no room to boost
the current down the road.

Comments Welcome!
By Random
#42305
I'm definitely happy with the current brightness - I don't want the LEDs to light anything up, just show a message. I could potentially up the brightness later anyway -- if I cut out one colour or the other, I can double the duty cycle of the anodes, although the cathodes would stay the same. I should still be well within spec of the 74HC595s.
User avatar
By bigglez
#42306
Greetings Adam,
Random wrote: The LEDs are indeed rated at 2V forward, and at 330ohm that's 6mA - exactly on spec for the 74HC595? (Unless my maths is wrong here...)
The key to understanding this problem is two
characteristics of the drivers in the 'HC595.

Firstly, it's a logic device which was intended to
drive other logic devices, and as such is spec'd to
6mA. Drawing greater current will cause a larger
voltage droop at the output, compromising the
logic noise margin but not damaging the device.

This voltage drop will lower the current in the LED
as the equivalent output impedance of the driver
is now in series with the external resistor (330R).

Secondly, The device is rated for an abs max
per driver current of 25mA, but individual devices
or those from other vendors may do much better.
The greater concern would be that heavily loaded
outputs would increase the power dissipated, and
toast the device. You might not reach this critical
point with DIP packages (larger mass) or you
may have sufficient heatsinking through the
pins and protoboard not to have a failure.

Random wrote:As a side thought, though, if the abs. max spec on the shift register is 25mA per channel, and I'm currently driving mine at 8*6=48mA, almost twice the abs. max, where's the magic smoke? I can't believe it'd keep on running at twice its abs max for weeks.
Are you sure that's the actual current? I think you'll
find that loading the outputs has dropped the
voltage available to the resistor.

As an experiment measure the voltage across the
330R resistor(s). A dual channel scope would be best
but even a DC meter reading will reveal that the
voltage is not what you expect (5 - 3 = 2V, 2/330 = 6mA).

Comments Welcome!