Drivings LED with limited pins

On Thu, 13 Mar 2014 07:23:41 GMT, Jan Panteltje <pNaonStpealmtje@yahoo.com> wrote:
On a sunny day (Wed, 12 Mar 2014 13:28:19 -0700 (PDT)) it happened
Lasse Langwadt Christensen <langwadt@fonz.dk> wrote in
56ca6bc2-2c58-4631-a331-29a044fe8f02@googlegroups.com>:

I'm not expert on linux, but can't you just memmap the gpio
registers and hammer away if you like ?

yes, I have tried that amd the maximum throughput i get is about 5
MHz toggle on a GPIO pin. You STILL get interrupts from the
taskswitching, the processor can only do one thing at the time.

but the access speed doesn't help when the OS interrupts at random
times

if you could prevent it from switching task while you burst out an
update I think you could drive a string of WS2812

Yes but the thing would be tied up all the time and not be able to
do anything else.
SPI with some memory in the driver chips is so much simpler.
Hardware solution.

Okay. I think I get the picture. In any case, I need to review the
LPD8806 datasheet with a little more care.

Thanks, guys.


Frank
--
I have never understood why it is "greed" to want to keep the money
you have earned, but it is not greed to want take someone else's
money. -- Thomas Sowell
--
Frank McKenney, McKenney Associates
Richmond, Virginia / (804) 320-4887
Munged E-mail: frank uscore mckenney aatt mindspring ddoott com
 
On Wed, 12 Mar 2014 19:07:49 -0700 (PDT), Bill Sloman
<bill.sloman@gmail.com> wrote:

On Thursday, 13 March 2014 09:24:09 UTC+11, John Fields wrote:
On Tue, 11 Mar 2014 20:56:42 -0700 (PDT), Bill Sloman
bill.sloman@gmail.com> wrote:
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.

Not true.

It's precisely because of the nature of TDM that the problem exists
in the first place.

If you can get away with turning on only one LED at a time, you aren't time domain multiplexing - or not at least in the way the TDM is conventionally understood.

---
If you had an array of two LEDs and you turned them on one at a time
and mutually exclusively in a cyclic manner, that's multiplexing,
and seems to be at odds with what you claim multiplexing to be.
---

>You can leave your single LED turned on for longer than the flicker fusion period, and you wouldn't want to put more than 20mA through it.

---
Gobbledygook.

The flicker fusion period, defined, requires some ON and some OFF
time per cycle, and for the apparent brightness of the switched LED
to be equal to that of an equivalent LED driven statically, the peak
current through the switched LED must be greater than the continuous
current through an equivalent LED driven continuously, whatever the
current through the latter.
---

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

Your squabbles with Larkin are of little import to me since what I
was addressing were the inadequacies of TDM for the purpose at hand.

---
However, examining the matter a little more closely reveals that you
missed that Larkin's 14 pin solution driving a 12 X 2 array - will
fill the bill.
---

>Which I dealt with by suggesting that that scheme wasn't all that attractive if you wanted more than one LED on at one time.

---
A conventionally multiplexed 12 X 2 array will allow either up to 12
LEDs or up to 2 LEDs to be on at the same time, depending on whether
the array is configured as 12 rows X 2 columns or 2 rows X 12
columns.
---

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.

That's to be decided once the inadequacies of the system are
identified and suitable compromises made to work around them, if
desired.

In this case, with a single shift register capable of driving the
LEDs to their continuous If spec, touting the use of TDM seems
ill-advised.

Since I wasn't touting it - quite the reverse, if anything - this is being censorious about something that I wasn't saying. Your imperfect comprehension of complex sentences has let you down again.

---
Since the reference to the touter was non-specific, one would think
that imperfect comprehension of that complex sentence - not to
mention your Narcissistic personality disorder - led to your
confusion.
---

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,

Hmmm... More's the pity, since it's all there in black and white.

Actually it's all in your unfortunate misunderstanding of what has been posted.

---
You posted: "The 460mA assumes that you need the maximum permissible
current through the LED to make it visible.", so it should be
clearly understandable to even a casual observer somewhat familiar
with the art that the misapprehension lies wholly within your camp.
---

Seems like your grasp of the obvious isn't so remarkable after
all...

While your failure to grasp the obvious point that you are barking up the wrong tree is as obvious as ever.

---
Don't own up to the mistake, shoot the messenger instead?
---

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.

Not true.

Most - if not all - data sheets list the "absolute maximum" forward
current as the current the LED can sustain for a prolonged period
without damage, and also give the nominal forward current for a
given output, generally under "electrical characteristics" or some
such.

So what? You aren't under any obligation to run it that bright, and for lots of LEDs that brightness is uncomfortably high if the LED is being used an indicator. If it's being used as an illumination source it does make sense to run it at the maximum permissilbe current, but the OP was talking about indicator LEDs, not illuminating LEDs.

---
Red Herring.
---

There's also a maximum pulse current rating given with the duty
cycle limitations specified.

Many LEDs are a bit too bright when run at their maximum sustained current.

Bob and weave, Mr. Sloman, bob and weave.

Educating you may look like bobbing a weaving to you - but to the rest of us it looks rather more like trying to put food into the mouth of a restless baby.

---
Rather a meaningless metaphor, since "the rest of us" refers to your
imaginary posse, whose weight of opinion parallels yours.
---

And it's Dr. Sloman to you.

http://cat.lib.unimelb.edu.au/search~S30?/XA+W+Sloman&SORT=D&searchscope=30/XA+W+Sloman&SORT=D&searchscope=30&SUBKEY=A+W+Sloman/1%2C27%2C27%2CB/frameset&FF=XA+W+Sloman&SORT=D&searchscope=30&1%2C1%2C

---
I calls 'em the way I sees 'em...
---

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.

Well, when someone makes fishy statements, what else would you
expect?

Your judgement of what is "fishy", like your reading comprehension, is somewhat less than reliable.

---
Argumentum ad ignorantiam.
---

"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.

---
Argumentum ad ignorantiam.
---

Existence doesn't wink out because of the "beholder's" blinders.

You put your blinkers on exhibition with somewhat excessive enthusiasm.

---
My blinkers, but you wear them, much like my feedbag.
---

If you weren't so insistent about telling us that you can't parse complex
sentences reliably, we'd probably never have known.

---
JF = BS???

In neither sense is that true, regardless of the "testimony" of your
imaginary posse.
---


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.

Ad hominem.

You flatter yourself. Your sentence comprehension is distinctly sub-human.

---
Ah, then, that belief certainly explains away the paucity of reason
in your carefully crafted attempts at communication.
---

>More seriously you are making a point that depends on your personal misreading of stuff I posted.

---
But it behooves you, as an author, to tailor your stuff to the level
of understanding of your readers so, if you know you're writing for
sub-humans and think you're being misunderstood, the culpability is
yours.
---

Pointing out that you - as an individual - have made the same mistake
here as you have made in the past, of reading something into a posted
text that isn't actually there, is necessarily ad hominem.
You made the mistake that I am reacting to.

---
The misunderstanding may be mine, but the culpability for the
misunderstanding is clearly yours since a good writer would have
made misunderstanding impossible.
---

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.

The link you refer is only concerned with fusion frequency as a
function of several variables; not with the amplitude response of
the eye as a function of source brightness.

Really?

---
Really.

You must have read something extraneous into the info at the link.
---


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.

When rational discourse can only lead to disaster, ad hominem seems
to be the course you plot.

As I said, you flatter yourself.

---
It must seem like that when Bill Sloman's "logic" is called into
question and it falls flatter than a pancake on even cursory
examination.
---

You might educate yourself by reading this link.

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

Thank you.

Quite enlightening, but rather irrelevant.

Then clearly not enlightening enough.

---
Indeed, but perhaps I missed the relevant part of the article.

Can you point to it?
 
On Wed, 12 Mar 2014 22:47:44 -0700, josephkk
<joseph_barrett@sbcglobal.net> wrote:

On Mon, 10 Mar 2014 20:18:47 -0500, John Fields
jfields@austininstruments.com> wrote:

On Mon, 10 Mar 2014 15:34:48 -0700 (PDT), 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?

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

2X TLC5926/TLC5927:

http://www.ti.com/lit/ds/slvs677/slvs677.pdf

John Fields

I like this one. Easy to multiplex 2 or even more ways, 16 outputs, small
TDM brightness price (will do 32 LEDs at 2-way).

?-)

---
No TDM needed since 2 in series will get you up to 32 fully static
constant-current outputs to drive the LEDs with only 3 bits in:
serial data, data clock, and latch clock.

John Fields
 
On Wed, 12 Mar 2014 23:08:28 -0700, josephkk
<joseph_barrett@sbcglobal.net> wrote:

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.

Hmmm. Using 3 would cost no more than 6 pins and has a spare output,
static display, and minimal code cost. A little coding could cut this to
4 pins.

?-)

---
Why would you want to use 3 when you can get by with one?
 

Welcome to EDABoard.com

Sponsor

Back
Top