Drivings LED with limited pins

you could use one of the spare states to reset all the bits, and have another spare state near that state for resting.

And then you have a mess of asynchronous logic to handle this...

toggling any led then becomes an excursion through hamming space to toggle the led and then a return through the same hamming space back to the rest state to un-toggle all the leds you hit on the way to the target.

It'd make a good programming excercise but little else.

the shift register approach is to be preferred, IIRC there are some led drivers that can control 30 leds from 2 input pins.

--
Neither the pheasant plucker, nor the pheasant plucker's son. 


--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
Reply to
Jasen Betts
Loading thread data ...

design challenge is that I only have about 17 pins available on my SoC.

ital interface (spi/i2c) and then send over data to toggle the appropriate pins?

nt on a second microcontroller.

ng

n - on its own - isn't quite what the OP is asking for. He wants to "toggle " the LEDs.

en "on" and "off" but since you don't know how they started up (or got repr ogrammed by a recent lightning strike) this isn't all that useful. Using on e of the nine spare states as a global reset - to turn them all off - would get around that problem. Adding a sixth pin - so you could set the selecte d LED explicitly "on" or "off" - would make life easier.

I just said that "Using one of the nine spare states as a global reset - to turn them all off"

It doesn't have to be asynchronous. There's nothing to stop you from inspec ting the states of the inputs at every rising (or falling) clock edge, and ignoring them for the rest of the time. You probably need to read up on "de

-bouncing" switches.

e

Which is why most people go for clocked state machines.

Some of them have been listed in this thread. Some of us have tried to buy them from time to time and tend to prefer more general purpose parts that a re likely to stay available for longer.

The shift register approach certainly uses up fewer pins.

--
Bill Sloman, Sydney
Reply to
Bill Sloman

Oh yes, there is (misos?) MAX7219 for example.

--

John Devereux
Reply to
John Devereux

Jan,

Those strips reportedly use the LPD8806 driver rather than the WS2812. Are you familiar enough at this point with the LPD8806 to say what it is about those that's better -- for the R'Pi -- than the WS2812?

I've skimmed this:

Topic: Individually addressable RGB LED comparison?

formatting link

but I guess I don't know enough about the R-Pi's pin I/O to know why

-- as the AdaFruit notes indicate -- the WS2812 isn't R'Pi material.

Frank

--
  ...[I]n the nineteenth century, reading novels was criticized for 
  exactly the same reasons for which watching television is criticized 
  today.    -- Paul Cantor / The Invisible Hand in Popular Culture
Reply to
Frnak McKenney

sign challenge is that I only have about 17 pins available on my SoC.

Yes, the 74HC259 addressable latch can solve this problem easily (more easi ly than the 'shift register' approach, which will have transient current through LE Ds that you wanted dark).

There are also I/O expander chips that are intended for such tasks: PCF8574 will give you bidirectional latched I/O, eight bits at a time, for I2C bus. XRA1405 doe s sixteen bits at a time, for SPI bus.

Reply to
whit3rd

On a sunny day (Wed, 12 Mar 2014 12:50:32 -0500) it happened Frnak McKenney wrote in :

No, I have not used this chip, but they say this here:

formatting link
example code for using with the Arduino Uno/Mega microcontroller at 8MHz and 16MHz, but it will not work with the Raspberry Pi, Basic Stamp, NETduino, any other interpreted/virtual machine microprocessor or any processor slower than 8 MHz. For those processors, check our 32 LED/meter digital LED strip which has SPI-like input/output and works well with Pi, NETduino, and other processors. So I looked up that [other] strip, it seems to be about timing, that strip is SPI and not critical like the arduino only one it seems.

If it is timing, and the Raspi runs Linux, there will be several ms long interruptions due to task switching. There is however also risc-os for raspberry, I tried it, it runs, but have no clue how to use it, so I used that SDcard for something else, but that risc-os should not have the taskswitch problem ? Not sure. I do not think speed is an issure with Raspi.

Reply to
Jan Panteltje

design challenge is that I only have about 17 pins available on my SoC.

.
y

sily than

LEDs that

not if you use something like a 74HC595

74 will give you

oes sixteen bits

then you might as well use something like:

formatting link

4286441

-Lasse

Reply to
Lasse Langwadt Christensen

In things like the Rasberry Pi, Beaglebone, and the others that run Linux the pin I/O is via a file system. The allocate, open, read/write, close for a pin make it an order of magnitude slower (real time) than direct hardware access as in the Arduino.

Reply to
Dennis

--
Not true. 
It's precisely because of the nature of TDM that the problem exists 
in the first place.
Reply to
John Fields

The instructor has thought of all of the details, including multiplexing states for an "always on" appearance instead of any combo being always "static" or latched. Then again, all of it is trivial...

Reply to
Robert Baer

The serial approach has a problem - needs milk.

Reply to
Robert Baer

The design challenge is that I only have about 17 pins available on my So C.

e digital interface (spi/i2c) and then send over data to toggle the appropr iate pins?

lopment on a second microcontroller.

D on at any one time (a opposed to toggling any one of 23) but it would onl y 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 (b ut only one) could be turned on to connect to - say - +5V.

f the five different anode groups) would be connected together to one of fi ve common NPN collectors, any one of which (but only one) could be turned o n to connect to the 0V rail.

,

to turn on one LED out of the 23, rather than potentially turning on all 2

3 in sequence.

be a problem.

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.

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.

4 pins" for the multiplexed approach.

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

any cases a LED can be an adequate indicator at 5% of maximum brightness, a nd - at least for some LEDs - the limit on pulsed peak current can be highe r than the limit on the sustained current. I once used a LED as a strobosco pe, at it's pulsed current limit of 80mA. It wasn't very bright, but it was bright enough.

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

r

gh the LED to make it visible.

,

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

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

So what? You aren't under any obligation to run it that bright, and for lot s 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.

ent.

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

And it's Dr. Sloman to you.

formatting link

u

. the only weaseling going on here is your mindless enthusiasm for discover ing stuff to carp about.

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

even be true.

You put your blinkers on exhibition with somewhat excessive enthusiasm. If you weren't so insistent about telling us that you can't parse complex sent ences reliably, we'd probably never have known.

You flatter yourself. Your sentence comprehension is distinctly sub-human. More seriously you are making a point that depends on your personal misread ing of stuff I posted. Pointing out that you - as an individual - have made the same mistake here as you have made in the past, of reading something i nto a posted text that isn't actually there, is necessarily ad hominem. You made the mistake that I am reacting to.

od - 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 se em to think.

Really?

ke it necessary for me to produce a formal proof of error.

As I said, you flatter yourself.

Then clearly not enlightening enough.

--
Bill Sloman, Sydney
Reply to
Bill Sloman

design challenge is that I only have about 17 pins available on my SoC.

tal interface (spi/i2c) and then send over data to toggle the appropriate p ins?

t on a second microcontroller.

ing

n - on its own - isn't quite what the OP is asking for. He wants to "toggle " the LEDs.

en "on" and "off" but since you don't know how they started up (or got repr ogrammed by a recent lightning strike) this isn't all that useful. Using on e of the nine spare states as global reset - to turn them all off - would g et around that problem. Adding a sixth pin - so you could set the selected LED explicitly "on" or "off" - would make life easier.

s.

Instructors do say that. Few believe them.

--
Bill Sloman, Sydney
Reply to
Bill Sloman

design challenge is that I only have about 17 pins available on my SoC.

digital interface (spi/i2c) and then send over data to toggle the appropriate pins?

on a second microcontroller.

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

?-)

Reply to
josephkk

McKenney

WS2812.

8MHz and 16MHz,

processor slower than 8 MHz.

which has SPI-like input/output

strip is SPI and not critical like the

long interruptions due to task switching.

have no clue how to use it,

have the taskswitch problem ? Not sure.

I do NOT think that a device like would be expressed as a file system, all kinds of inappropriate overhead would get included. It would show up as a character device (or device group). Then one open, and writes show up immediately on the device.

?-)

Reply to
josephkk

design challenge is that I only have about 17 pins available on my SoC.

74HC574.

multiplexing.

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.

?-)

Reply to
josephkk

ideas.

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

2261

pin or total sink current for all the pins together.

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.

regulated voltage?

The device has 2 "power" pins, V(ccp) should go direct to the battery, and V(cci) should go to the regulator to match the i2c bus voltages.

Then when I put this low I should be able to sink 25 mA per pin. Right?

Reply to
josephkk

On a sunny day (Wed, 12 Mar 2014 13:28:19 -0700 (PDT)) it happened Lasse Langwadt Christensen wrote in :

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.

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.

Reply to
Jan Panteltje

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
Reply to
Frnak McKenney

--
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.
Reply to
John Fields

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.