Drivings LED with limited pins

Mike Miller <mikemillernow@gmail.com> wrote:
All,

I want to be able to toggle 23 separate LEDs in my application. The design challenge is that I only have about 17 pins available on my SoC.

What are some options for this?
17 pins are a lot. The simplest solution are 3 8-bit registers like 74HC574.
You need 11 pins; 8 for the data and 1 for any clock to the register.
Drawback is that you need 23 current limiting resistors. Advantage is
that it is static and you dont need a periodical routine for multiplexing.

--
Dipl.-Inform(FH) Peter Heitzer, peter.heitzer@rz.uni-regensburg.de
HTML mails will be forwarded to /dev/null.
 
On 11 Mar 2014 09:23:54 GMT, "Peter Heitzer"
<peter.heitzer@rz.uni-regensburg.de> wrote:

Mike Miller <mikemillernow@gmail.com> wrote:
All,

I want to be able to toggle 23 separate LEDs in my application. The design challenge is that I only have about 17 pins available on my SoC.

What are some options for this?
17 pins are a lot. The simplest solution are 3 8-bit registers like 74HC574.
You need 11 pins; 8 for the data and 1 for any clock to the register.
Drawback is that you need 23 current limiting resistors. Advantage is
that it is static and you dont need a periodical routine for multiplexing.

---
The OP has 17 I/Os available and needs 2 for an 8 bit shift
register's serial data and data clock inputs.

Using a single 8 bit register with bus driver outputs will allow him
to source/sink 8 LEDs, which leaves him with 15 I/Os on the SoC for
the rest of the LEDs.

8 LEDs fed from the shift register, plus 15 from the SoC is 23, so
the simplest solution for a quasi-static display which can address
any or all LEDs in the array would seem to be something like an
HC575 (less than 60 cents in onesies from Digi-Key) plus the current
limiting resistors.
 
On Mon, 10 Mar 2014 16:15:27 -0700 (PDT), Bill Sloman
<bill.sloman@gmail.com> wrote:


>The shift register solution is more elegant and more flexible, and might be cheaper - 3 x 74HCT595 plus 23 current-limiting resistors is probably cheaper than five discrete PNP transistors, five discrete NPN transistors, five current limiting resistors and ten base drive transistors. Even the part count is almost the same

---
Since the OP has 17 I/Os available and needs two for the shift
register's serial data and data clock inputs, he'll have 15 left
over which he can use to drive the LEDs directly.

Those 15, configured as outputs and added to the shift register's 8
outputs is 23 which - with the current-limiting resistors - comes
out to exactly what the OP says he needs.

The _single_ shift register needed, BTW, should be an HC374 in order
to eliminate the latch clock, which the 595 needs, and supply the
serial bus-driver rated outputs which the 595 lacks.
 
On Tue, 11 Mar 2014 06:53:39 -0500, John Fields
<jfields@austininstruments.com> wrote:

On 11 Mar 2014 09:23:54 GMT, "Peter Heitzer"
peter.heitzer@rz.uni-regensburg.de> wrote:

Mike Miller <mikemillernow@gmail.com> wrote:
All,

I want to be able to toggle 23 separate LEDs in my application. The design challenge is that I only have about 17 pins available on my SoC.

What are some options for this?
17 pins are a lot. The simplest solution are 3 8-bit registers like 74HC574.
You need 11 pins; 8 for the data and 1 for any clock to the register.
Drawback is that you need 23 current limiting resistors. Advantage is
that it is static and you dont need a periodical routine for multiplexing.

---
The OP has 17 I/Os available and needs 2 for an 8 bit shift
register's serial data and data clock inputs.

Using a single 8 bit register with bus driver outputs will allow him
to source/sink 8 LEDs, which leaves him with 15 I/Os on the SoC for
the rest of the LEDs.

8 LEDs fed from the shift register, plus 15 from the SoC is 23, so
the simplest solution for a quasi-static display which can address
any or all LEDs in the array would seem to be something like an
HC575 (less than 60 cents in onesies from Digi-Key) plus the current
limiting resistors.

---
HC374
 
On Mon, 10 Mar 2014 15:34:48 -0700 (PDT) Mike Miller
<mikemillernow@gmail.com> wrote in Message id:
<613c339a-c651-415e-a46c-03c46223c937@googlegroups.com>:

All,

I want to be able to toggle 23 separate LEDs in my application. The design challenge is that I only have about 17 pins available on my SoC.

What are some options for this?

1.) Use another microcontroller with 23 available pins with some digital interface (spi/i2c) and then send over data to toggle the appropriate pins?

2.) Ideally I don't want to have to do additional firmware development on a second microcontroller.

Thank you for any ideas.

A simple solution might be three 74LS138 chips. No multiplexing needed.
 
Den tirsdag den 11. marts 2014 16.12.05 UTC+1 skrev Jan Panteltje:
On a sunny day (11 Mar 2014 14:09:00 GMT) it happened "Peter Heitzer"

peter.heitzer@rz.uni-regensburg.de> wrote in

bo8jnsF48nuU1@mid.individual.net>:



JW <none@dev.null> wrote:

On Mon, 10 Mar 2014 15:34:48 -0700 (PDT) Mike Miller

mikemillernow@gmail.com> wrote in Message id:

613c339a-c651-415e-a46c-03c46223c937@googlegroups.com>:



All,



I want to be able to toggle 23 separate LEDs in my application. The design challenge is that I only have about 17 pins

available on my SoC.



What are some options for this?



1.) Use another microcontroller with 23 available pins with some digital interface (spi/i2c) and then send over data to toggle

the appropriate pins?



2.) Ideally I don't want to have to do additional firmware development on a second microcontroller.



Thank you for any ideas.



A simple solution might be three 74LS138 chips. No multiplexing needed.

That won´t work without some sort of multiplexing as the `138 can only

drive one out of eight a time. 74x259 instead of 74x138 would work.



How about 15 pins for LEDs, and one I2C PCF8574 I/O expander on pin 16 and 17 driving 8 more LEDs, makes 23.

If you are lucky you already have I2C somehere, and then have 2 pins free for other things.

One chip.

two resistors, three pins and two of these:

http://www.digikey.com/product-detail/en/IS31FL3726-QFLS2-TR/706-1218-1-ND/4286441


-Lasse
 
On Mon, 10 Mar 2014 16:15:27 -0700 (PDT), Bill Sloman
<bill.sloman@gmail.com> wrote:

On Tuesday, 11 March 2014 09:36:41 UTC+11, John Larkin wrote:
On Mon, 10 Mar 2014 15:34:48 -0700 (PDT), Mike Miller
mikemillernow@gmail.com> wrote:

I want to be able to toggle 23 separate LEDs in my application. The design challenge is that I only have about 17 pins available on my SoC.

What are some options for this?

1.) Use another microcontroller with 23 available pins with some digital interface (spi/i2c) and then send over data to toggle the appropriate pins?

2.) Ideally I don't want to have to do additional firmware development on a second microcontroller.

Thank you for any ideas.

Multiplex them (14 pins), or use a shift register (3 pins.)

The simplest sort of multiplexer would only be able to turn one LED on at any one time (a opposed to toggling any one of 23) but it would only use 10 lines for a 5x5 matrix. You'd connect the anode pins of groups of five LEDs together to a common current-limiting resistor, and connect each of the five resistors back to five PNP open collectors, any one of which (but only one) could be turned on to connect to - say - +5V.

Similarly the cathode pins of groups of five LEDs (one from each of the five different anode groups) would be connected together to one of five common NPN collectors, any one of which (but only one) could be turned on to connect to the
0V rail.

---
What you haven't touched on is that for apparently equal brightness,
the current through any LED in the array must be at least 23 times
that for an identical LED run static.

For a 20mA LED, then, that comes to some 460mA at about a 5% duty
cycle; a no-no, I believe.

Also, assuming a 5V supply, 2V LEDs, and two 0.3V Vce(sat) drops for
the row and column drivers leaves 2.4V to be dropped across the
current limiting resistor with 460mA through it.

That's about 5.2 ohms which, with 460mA through it equals about 1.1
watts. But, since a single resistor can only carry current for
5/23rds of the time, the maximum dissipation falls to 240
milliwatts.

Not too shabby, but I think that 23-fold increase in the current
through the LED is going to hurt.

John Fields
 
JW <none@dev.null> wrote:
On Mon, 10 Mar 2014 15:34:48 -0700 (PDT) Mike Miller
mikemillernow@gmail.com> wrote in Message id:
613c339a-c651-415e-a46c-03c46223c937@googlegroups.com>:

All,

I want to be able to toggle 23 separate LEDs in my application. The design challenge is that I only have about 17 pins available on my SoC.

What are some options for this?

1.) Use another microcontroller with 23 available pins with some digital interface (spi/i2c) and then send over data to toggle the appropriate pins?

2.) Ideally I don't want to have to do additional firmware development on a second microcontroller.

Thank you for any ideas.

A simple solution might be three 74LS138 chips. No multiplexing needed.
That won´t work without some sort of multiplexing as the `138 can only
drive one out of eight a time. 74x259 instead of 74x138 would work.

--
Dipl.-Inform(FH) Peter Heitzer, peter.heitzer@rz.uni-regensburg.de
HTML mails will be forwarded to /dev/null.
 
On Wednesday, 12 March 2014 00:16:30 UTC+11, John Fields wrote:
On Mon, 10 Mar 2014 16:15:27 -0700 (PDT), Bill Sloman
bill.sloman@gmail.com> wrote:
On Tuesday, 11 March 2014 09:36:41 UTC+11, John Larkin wrote:
On Mon, 10 Mar 2014 15:34:48 -0700 (PDT), Mike Miller
mikemillernow@gmail.com> wrote:

I want to be able to toggle 23 separate LEDs in my application. The design challenge is that I only have about 17 pins available on my SoC.

What are some options for this?

1.) Use another microcontroller with 23 available pins with some digital interface (spi/i2c) and then send over data to toggle the appropriate pins?

2.) Ideally I don't want to have to do additional firmware development on a second microcontroller.

Thank you for any ideas.

Multiplex them (14 pins), or use a shift register (3 pins.)

The simplest sort of multiplexer would only be able to turn one LED on at any one time (a opposed to toggling any one of 23) but it would only use 10 lines for a 5x5 matrix. You'd connect the anode pins of groups of five LEDs together to a common current-limiting resistor, and connect each of the five resistors back to five PNP open collectors, any one of which (but only one) could be turned on to connect to - say - +5V.

Similarly the cathode pins of groups of five LEDs (one from each of the five different anode groups) would be connected together to one of five common NPN collectors, any one of which (but only one) could be turned on to connect to the
0V rail.

What you haven't touched on is that for apparently equal brightness,
the current through any LED in the array must be at least 23 times
that for an identical LED run static.

True. But obvious, but I was talking about using the multiplexed approach to turn on one LED out of the 23, rather than potentially turning on all 23 in sequence.

For a 20mA LED, then, that comes to some 460mA at about a 5% duty
cycle; a no-no, I believe.

Only if you want to run the 20mA LED at it's maximum brightness. In many cases a LED can be an adequate indicator at 5% of maximum brightness, and - at least for some LEDs - the limit on pulsed peak current can be higher than the limit on the sustained current. I once used a LED as a stroboscope, at it's pulsed current limit of 80mA. It wasn't very bright, but it was bright enough.

Also, assuming a 5V supply, 2V LEDs, and two 0.3V Vce(sat) drops for
the row and column drivers leaves 2.4V to be dropped across the
current limiting resistor with 460mA through it.

The 460mA assumes that you need the maximum permissible current through the LED to make it visible. The eye's response is logarithmic, not linear and 2ma is often all you need, particularly with "high brightness" LED's.

<snip>

--
Bill Sloman, Sydney
 
On 11 Mar 2014 14:09:00 GMT "Peter Heitzer"
<peter.heitzer@rz.uni-regensburg.de> wrote in Message id:
<bo8jnsF48nuU1@mid.individual.net>:

JW <none@dev.null> wrote:
On Mon, 10 Mar 2014 15:34:48 -0700 (PDT) Mike Miller
mikemillernow@gmail.com> wrote in Message id:
613c339a-c651-415e-a46c-03c46223c937@googlegroups.com>:

All,

I want to be able to toggle 23 separate LEDs in my application. The design challenge is that I only have about 17 pins available on my SoC.

What are some options for this?

1.) Use another microcontroller with 23 available pins with some digital interface (spi/i2c) and then send over data to toggle the appropriate pins?

2.) Ideally I don't want to have to do additional firmware development on a second microcontroller.

Thank you for any ideas.

A simple solution might be three 74LS138 chips. No multiplexing needed.
That won´t work without some sort of multiplexing as the `138 can only
drive one out of eight a time. 74x259 instead of 74x138 would work.

I was assuming that the OP only needed to light one at a time. I very well
could be wrong...
 
All,

Thank you so much for the awesome posts. Lots of good information and ideas.

I have been working on my schematic late last night and the update is that for the 23 LEDs I have exactly 2 free pins available to drives these. Turns out the I2C peripheral is on these pins (SDA / SCL).

Follow up questions:

1.) I2C Port expander

Looking at this part:

http://www.digikey.com/product-detail/en/TCA6424RGJR/296-23306-2-ND/1832261

I can sink 25 mA and also have enough pins to cover the 23 LEDs.

Looking at the datasheet it is not clear to me if the 25 mA sink is per pin or total sink current for all the pins together.

What are you thoughts on this? Any issues that you can think of?


2.) Power Supply issue.

I am powering my device with a CR2045 coin cell battery that will provide a voltage of 3.0V - 2.0V. I have added an LDO regulator to give me a fixed 2.1V. I did this because I am using the ADC on a microcontroller and wanted a fixed reference.

The I2C port expander operates in the range of 1.65 V - 5.5 V.

Should I give the I2c port expander the direct battery voltage or the regulated voltage?

To turn the LEDs off I should enable the i/o pin to be high impedance. Then when I put this low I should be able to sink 25 mA per pin. Right?

Thanks for you comments.

-Mike
 
On a sunny day (11 Mar 2014 14:09:00 GMT) it happened "Peter Heitzer"
<peter.heitzer@rz.uni-regensburg.de> wrote in
<bo8jnsF48nuU1@mid.individual.net>:

JW <none@dev.null> wrote:
On Mon, 10 Mar 2014 15:34:48 -0700 (PDT) Mike Miller
mikemillernow@gmail.com> wrote in Message id:
613c339a-c651-415e-a46c-03c46223c937@googlegroups.com>:

All,

I want to be able to toggle 23 separate LEDs in my application. The design challenge is that I only have about 17 pins
available on my SoC.

What are some options for this?

1.) Use another microcontroller with 23 available pins with some digital interface (spi/i2c) and then send over data to toggle
the appropriate pins?

2.) Ideally I don't want to have to do additional firmware development on a second microcontroller.

Thank you for any ideas.

A simple solution might be three 74LS138 chips. No multiplexing needed.
That won´t work without some sort of multiplexing as the `138 can only
drive one out of eight a time. 74x259 instead of 74x138 would work.

How about 15 pins for LEDs, and one I2C PCF8574 I/O expander on pin 16 and 17 driving 8 more LEDs, makes 23.
If you are lucky you already have I2C somehere, and then have 2 pins free for other things.
One chip.
 
On a sunny day (Tue, 11 Mar 2014 09:45:28 -0700 (PDT)) it happened Lasse
Langwadt Christensen <langwadt@fonz.dk> wrote in
<ff1e2339-30ba-4534-a6d4-da1857aa2ad8@googlegroups.com>:

Den tirsdag den 11. marts 2014 16.12.05 UTC+1 skrev Jan Panteltje:
On a sunny day (11 Mar 2014 14:09:00 GMT) it happened "Peter Heitzer"

peter.heitzer@rz.uni-regensburg.de> wrote in

bo8jnsF48nuU1@mid.individual.net>:



JW <none@dev.null> wrote:

On Mon, 10 Mar 2014 15:34:48 -0700 (PDT) Mike Miller

mikemillernow@gmail.com> wrote in Message id:

613c339a-c651-415e-a46c-03c46223c937@googlegroups.com>:



All,



I want to be able to toggle 23 separate LEDs in my application. The d=
esign challenge is that I only have about 17 pins

available on my SoC.



What are some options for this?



1.) Use another microcontroller with 23 available pins with some digit=
al interface (spi/i2c) and then send over data to toggle

the appropriate pins?



2.) Ideally I don't want to have to do additional firmware development=
on a second microcontroller.



Thank you for any ideas.



A simple solution might be three 74LS138 chips. No multiplexing needed.

That won´t work without some sort of multiplexing as the `138 can only

drive one out of eight a time. 74x259 instead of 74x138 would work.



How about 15 pins for LEDs, and one I2C PCF8574 I/O expander on pin 16 an=
d 17 driving 8 more LEDs, makes 23.

If you are lucky you already have I2C somehere, and then have 2 pins free=
for other things.

One chip.

two resistors, three pins and two of these:

http://www.digikey.com/product-detail/en/IS31FL3726-QFLS2-TR/706-1218-1-ND/=
4286441

Yes that is nice, and cheap too :)
 
On Tue, 11 Mar 2014 07:21:43 GMT, Jan Panteltje <pNaonStpealmtje@yahoo.com> wrote:
On a sunny day (Mon, 10 Mar 2014 15:34:48 -0700 (PDT)) it happened Mike Miller
mikemillernow@gmail.com> wrote in
613c339a-c651-415e-a46c-03c46223c937@googlegroups.com>:

All,

I want to be able to toggle 23 separate LEDs in my application. The
design challenge is that I only have about 17 pins available on my
SoC.

What are some options for this?

1.) Use another microcontroller with 23 available pins with some
digital interface (spi/i2c) and then send over data to toggle
the appropriate pins?

2.) Ideally I don't want to have to do additional firmware
development on a second microcontroller.

Thank you for any ideas.

OK no problem, 32 LEDs:

https://www.sparkfun.com/products/retired/10312

These are the same idea (LED drivers with built-in shift registers),
but alive and well. People have reported driving 1000 LEDs from 3
pins with a fast uC. I have some, but haven't had a chance to use
them yet:

The Magic of NeoPixels
http://learn.adafruit.com/adafruit-neopixel-uberguide

$8 - Breadboard-friendly RGB Smart NeoPixel - Pack of 4
http://www.adafruit.com/products/1312

$17 - Adafruit NeoPixel Digital RGB LED Weatherproof Strip 30 LED
-1m - WHITE
http://www.adafruit.com/products/1376

Enjoy...


Frank McKenney
--
It is an interesting thing that the highways through the West seem
to always miss the most delightful places, and those most worth
seeing. One can travel through Arizona or Nevada on the highways
and never realize that there are such places as the White Mountain
country of Arizona or many of the finest sights in Nevada. The
same is true of half a dozen other western states. Highways are
built where it is easiest, and such routes do not take one into
the forests and canyons except where they cannot be avoided,
-- Louis L'Amour / The Sackett Companion
--
Frank McKenney, McKenney Associates
Richmond, Virginia / (804) 320-4887
Munged E-mail: frank uscore mckenney aatt mindspring ddoott com
 
On a sunny day (Tue, 11 Mar 2014 12:51:59 -0500) it happened Frnak McKenney
<frnak@far.from.the.madding.crowd.com> wrote in
<ysidnaiUAJ-i0ILOnZ2dnUVZ_u-dnZ2d@earthlink.com>:

On Tue, 11 Mar 2014 07:21:43 GMT, Jan Panteltje <pNaonStpealmtje@yahoo.com> wrote:
On a sunny day (Mon, 10 Mar 2014 15:34:48 -0700 (PDT)) it happened Mike Miller
mikemillernow@gmail.com> wrote in
613c339a-c651-415e-a46c-03c46223c937@googlegroups.com>:

All,

I want to be able to toggle 23 separate LEDs in my application. The
design challenge is that I only have about 17 pins available on my
SoC.

What are some options for this?

1.) Use another microcontroller with 23 available pins with some
digital interface (spi/i2c) and then send over data to toggle
the appropriate pins?

2.) Ideally I don't want to have to do additional firmware
development on a second microcontroller.

Thank you for any ideas.

OK no problem, 32 LEDs:

https://www.sparkfun.com/products/retired/10312

These are the same idea (LED drivers with built-in shift registers),
but alive and well. People have reported driving 1000 LEDs from 3
pins with a fast uC. I have some, but haven't had a chance to use
them yet:

The Magic of NeoPixels
http://learn.adafruit.com/adafruit-neopixel-uberguide

$8 - Breadboard-friendly RGB Smart NeoPixel - Pack of 4
http://www.adafruit.com/products/1312

$17 - Adafruit NeoPixel Digital RGB LED Weatherproof Strip 30 LED
-1m - WHITE
http://www.adafruit.com/products/1376

Enjoy...

I like this one, as i tcan (the ysay?) be driven by Raspberry"
http://www.adafruit.com/products/306

Still a bit expensive to hang 32 strips on the wall as wallpaper...
 
On Tue, 11 Mar 2014 12:02:51 -0700 (PDT), mrhenkvisser@gmail.com
wrote:

All,

Thank you so much for the awesome posts. Lots of good information and ideas.

I have been working on my schematic late last night and the update is that for the 23 LEDs I have exactly 2 free pins available to drives these. Turns out the I2C peripheral is on these pins (SDA / SCL).

Follow up questions:

1.) I2C Port expander

Looking at this part:

http://www.digikey.com/product-detail/en/TCA6424RGJR/296-23306-2-ND/1832261

I can sink 25 mA and also have enough pins to cover the 23 LEDs.

Looking at the datasheet it is not clear to me if the 25 mA sink is per pin or total sink current for all the pins together.

It is per output, but there is a limitation of 200mA total through
ground. That's absolute maximum, so it would be a good idea not to get
too close to that. If you went with 100mA you'd have 4mA per LED,
which more than enough for a decent LED.

What are you thoughts on this? Any issues that you can think of?


2.) Power Supply issue.

I am powering my device with a CR2045 coin cell battery that will provide a voltage of 3.0V - 2.0V. I have added an LDO regulator to give me a fixed 2.1V. I did this because I am using the ADC on a microcontroller and wanted a fixed reference.

Button cells, as well as having limited capacity, also have pretty
high internal impedance. AA cells might be a better choice.

The I2C port expander operates in the range of 1.65 V - 5.5 V.

Should I give the I2c port expander the direct battery voltage or the regulated voltage?

To turn the LEDs off I should enable the i/o pin to be high impedance. Then when I put this low I should be able to sink 25 mA per pin. Right?

Thanks for you comments.

-Mike
 
On Wednesday, 12 March 2014 12:27:17 UTC+11, John Fields wrote:
On Tue, 11 Mar 2014 11:24:51 -0700 (PDT), Bill Sloman
bill.sloman@gmail.com> wrote:
On Wednesday, 12 March 2014 00:16:30 UTC+11, John Fields wrote:
On Mon, 10 Mar 2014 16:15:27 -0700 (PDT), Bill Sloman
bill.sloman@gmail.com> wrote:
On Tuesday, 11 March 2014 09:36:41 UTC+11, John Larkin wrote:
On Mon, 10 Mar 2014 15:34:48 -0700 (PDT), Mike Miller
mikemillernow@gmail.com> wrote:

I want to be able to toggle 23 separate LEDs in my application. The design challenge is that I only have about 17 pins available on my SoC.

What are some options for this?

1.) Use another microcontroller with 23 available pins with some digital interface (spi/i2c) and then send over data to toggle the appropriate pins?

2.) Ideally I don't want to have to do additional firmware development on a second microcontroller.

Thank you for any ideas.

Multiplex them (14 pins), or use a shift register (3 pins.)

The simplest sort of multiplexer would only be able to turn one LED on at any one time (a opposed to toggling any one of 23) but it would only use 10 lines for a 5x5 matrix. You'd connect the anode pins of groups of five LEDs together to a common current-limiting resistor, and connect each of the five resistors back to five PNP open collectors, any one of which (but only one) could be turned on to connect to - say - +5V.

Similarly the cathode pins of groups of five LEDs (one from each of the five different anode groups) would be connected together to one of five common NPN collectors, any one of which (but only one) could be turned on to connect to the 0V rail.

What you haven't touched on is that for apparently equal brightness,
the current through any LED in the array must be at least 23 times
that for an identical LED run static.

True. But obvious. I was talking about using the multiplexed approach to turn on one LED out of the 23, rather than potentially turning on all 23 in sequence.

Yes, of course, but regardless of what you do using TDM, you'll
never get away from the need to increase the current through the
driven LED over its static value in order to elicit that static
brightness dynamically.

If you could get away with only turning on one LED at time, it wouldn't be a problem.

You should have realised that I was mainly objecting to John Larkin's "14 pins" for the multiplexed approach.

For a 20mA LED, then, that comes to some 460mA at about a 5% duty
cycle; a no-no, I believe.

Only if you want to run the 20mA LED at it's maximum brightness. In many cases a LED can be an adequate indicator at 5% of maximum brightness, and - at least for some LEDs - the limit on pulsed peak current can be higher than the limit on the sustained current. I once used a LED as a stroboscope, at it's pulsed current limit of 80mA. It wasn't very bright, but it was bright enough.

Exactly the strategy used with TDM but, unfortunately, as the number
of LEDs in the array increases, the peak current allowed through the
LEDs reaches a limit even though the apparent brightness may be
unsatisfactory.

But it may not.

Also, assuming a 5V supply, 2V LEDs, and two 0.3V Vce(sat) drops for
the row and column drivers leaves 2.4V to be dropped across the
current limiting resistor with 460mA through it.

The 460mA assumes that you need the maximum permissible current through the LED to make it visible.

No, the 460mA assumes that in a muxed array with a 1/23 duty cycle,
the muxed LED will appear to be as bright as an LED rated for 20mA
and excited by a constant current of 20mA.

I don't know what misapprehension you thought that were correcting there, but you do seem to have missed the point that the 20ma is the maximum sustained current that you can put through the LED rather than any kind of recommended operating current. Many LEDs are a bit too bright when run at their maximum sustained current

The eye's response is logarithmic, not linear and 2ma is often all you
need, particularly with "high brightness" LED's.

Weasel words.

Don't be silly. What I said is inarguably correct, and entirely relevant. the only weaseling going on here is your mindless enthusiasm for discovering stuff to carp about.

> "All you need" doesn't destroy the underpinnings of my argument,

Since you haven't made any kind of argument in the first place, this may even be true.

and the eye's response is logarithmic only when the source is
monochromatic, CW, and only the luminosity varies.

Don't be any stupider than you have to be.

With a pulsed source, all bets are off unless the luminosity, duty
cycle, and pulse repetition frequency are known.

Twaddle. The eye integrates the photons hitting it. The integration period - search on "flicker fusion frequency" - can be anything from 200msec in dim light to about 15msec in bright light. There are only three different light-absorbing pigments in the eye, so it's all rather simpler than you seem to think.

> Got a link to prove me wrong?

I don't need to prove you wrong - you do it yourself far too often to make it necessary for me to produce a formal proof of error. You might educate yourself by reading this link.

http://en.wikipedia.org/wiki/Flicker_fusion_threshold

--
Bill Sloman, Sydney
 
On Tue, 11 Mar 2014 11:24:51 -0700 (PDT), Bill Sloman
<bill.sloman@gmail.com> wrote:

On Wednesday, 12 March 2014 00:16:30 UTC+11, John Fields wrote:
On Mon, 10 Mar 2014 16:15:27 -0700 (PDT), Bill Sloman
bill.sloman@gmail.com> wrote:
On Tuesday, 11 March 2014 09:36:41 UTC+11, John Larkin wrote:
On Mon, 10 Mar 2014 15:34:48 -0700 (PDT), Mike Miller
mikemillernow@gmail.com> wrote:

I want to be able to toggle 23 separate LEDs in my application. The design challenge is that I only have about 17 pins available on my SoC.

What are some options for this?

1.) Use another microcontroller with 23 available pins with some digital interface (spi/i2c) and then send over data to toggle the appropriate pins?

2.) Ideally I don't want to have to do additional firmware development on a second microcontroller.

Thank you for any ideas.

Multiplex them (14 pins), or use a shift register (3 pins.)

The simplest sort of multiplexer would only be able to turn one LED on at any one time (a opposed to toggling any one of 23) but it would only use 10 lines for a 5x5 matrix. You'd connect the anode pins of groups of five LEDs together to a common current-limiting resistor, and connect each of the five resistors back to five PNP open collectors, any one of which (but only one) could be turned on to connect to - say - +5V.

Similarly the cathode pins of groups of five LEDs (one from each of the five different anode groups) would be connected together to one of five common NPN collectors, any one of which (but only one) could be turned on to connect to the
0V rail.

What you haven't touched on is that for apparently equal brightness,
the current through any LED in the array must be at least 23 times
that for an identical LED run static.

True. But obvious, but I was talking about using the multiplexed approach to turn on one LED out of the 23, rather than potentially turning on all 23 in sequence.

---
Yes, of course, but regardless of what you do using TDM, you'll
never get away from the need to increase the current through the
driven LED over its static value in order to elicit that static
brightness dynamically.
---

For a 20mA LED, then, that comes to some 460mA at about a 5% duty
cycle; a no-no, I believe.

Only if you want to run the 20mA LED at it's maximum brightness. In many cases a LED can be an adequate indicator at 5% of maximum brightness, and - at least for some LEDs - the limit on pulsed peak current can be higher than the limit on the sustained current. I once used a LED as a stroboscope, at it's pulsed current limit of 80mA. It wasn't very bright, but it was bright enough.

---
Exactly the strategy used with TDM but, unfortunately, as the number
of LEDs in the array increases, the peak current allowed through the
LEDs reaches a limit even though the apparent brightness may be
unsatisfactory.
---

Also, assuming a 5V supply, 2V LEDs, and two 0.3V Vce(sat) drops for
the row and column drivers leaves 2.4V to be dropped across the
current limiting resistor with 460mA through it.

The 460mA assumes that you need the maximum permissible current through the LED to make it visible.

---
No, the 460mA assumes that in a muxed array with a 1/23 duty cycle,
the muxed LED will appear to be as bright as an LED rated for 20mA
and excited by a constant current of 20mA.
---

The eye's response is logarithmic, not linear and 2ma is often all you need,
particularly with "high brightness" LED's.

---
Weasel words.

"All you need" doesn't destroy the underpinnings of my argument,
and the eye's response is logarithmic only when the source is
monochromatic, CW, and only the luminosity varies.

With a pulsed source, all bets are off unless the luminosity, duty
cycle, and pulse repetition frequency are known.

Got a link to prove me wrong?
 
On Wednesday, 12 March 2014 15:35:10 UTC+11, Robert Baer wrote:
Mike Miller wrote:

I want to be able to toggle 23 separate LEDs in my application. The design challenge is that I only have about 17 pins available on my SoC.

What are some options for this?

1.) Use another microcontroller with 23 available pins with some digital interface (spi/i2c) and then send over data to toggle the appropriate pins?

2.) Ideally I don't want to have to do additional firmware development on a second microcontroller.

Thank you for any ideas.

-Mike

Clue: using N pins, one has available 2^N states.
So all you need to use is 5 pins to control those 23 devices, leaving
9 unused states.

You need 5 pins to be able to select any one of these devices. Selection - on its own - isn't quite what the OP is asking for. He wants to "toggle" the LEDs.

Admittedly, just selecting any one LED could serve to "toggle" it between "on" and "off" but since you don't know how they started up (or got reprogrammed by a recent lightning strike) this isn't all that useful. Using one of the nine spare states as global reset - to turn them all off - would get around that problem. Adding a sixth pin - so you could set the selected LED explicitly "on" or "off" - would make life easier.

> I leave it to the student to fill in the details.

Which usually means that the instructor hasn't thought about the details.

--
Bill Sloman, Sydney
 
Mike Miller wrote:
All,

I want to be able to toggle 23 separate LEDs in my application. The design challenge is that I only have about 17 pins available on my SoC.

What are some options for this?

1.) Use another microcontroller with 23 available pins with some digital interface (spi/i2c) and then send over data to toggle the appropriate pins?

2.) Ideally I don't want to have to do additional firmware development on a second microcontroller.

Thank you for any ideas.

-Mike
Clue: using N pins, one has available 2^N states.
So all you need to use is 5 pins to control those 23 devices, leaving
9 unused states.
I leave it to the student to fill in the details.
 

Welcome to EDABoard.com

Sponsor

Back
Top