3
\$\begingroup\$

For those of you that haven't heard of the mbed I'd highly recommend having a look at it for rapid prototyping!

So, the mbed is a 100MHz microprocessor that appears as a usb mass storage device when you plug it into a computer via USB. You can program it by using an online IDE which spits out compiled binary files you can drag-drop into the drive (on any OS) making it a very versatile and very easy to use tool for beginners (like myself!)

As with all of these programmable ICs they have a limited number of IO pins, so if you wanted to drive 150 LEDs individually you'd need to have some kind of intermediatry control device. I'm considering using ATtiny devices to do just that:

  1. Is using ATtiny devices a good way to achieve control over a large number of LEDs? (considering my lack of experience with hardware)
  2. Would it be hard to port the code from the arduino ISP so that I could use my mbed as a programmer for programming ATtiny?
  3. Am I better off using PIC chips?

Many thanks!

\$\endgroup\$
1
  • \$\begingroup\$ You might want to ask three separate questions, since they aren't really related, instead of stuffing them all in one post. \$\endgroup\$
    – davr
    Commented Mar 15, 2010 at 19:43

5 Answers 5

6
\$\begingroup\$

I'd would rather use a shift register for this purpose (such as this one):

  • they are cheaper than a microcontroller
  • they are handier to drive a large number of led
  • code will be located only on the Mbed. Think that you'll have to update code on both the Mbed and the ATtiny at some point: juggling with different microcontrollers, tools and languages may become a real hassle.
\$\endgroup\$
1
  • 1
    \$\begingroup\$ Shift register worked great for me in the past to drive several 5x7 LED arrays with an HC11, so I recommend this approach! \$\endgroup\$
    – Dave
    Commented Dec 14, 2010 at 14:16
3
\$\begingroup\$

Why not use something like these?

PCF8574 I2C IO Expander

This is an I2C 8 bit IO expander, which you can add up to 8 of to a single I2C bus.

circuit

http://mbed.org/cookbook/PCF8574-I2C-IO-Expander

There is a 16-bit version, too. Then you can control one LED with each output pin, and put several on each I2C bus?

Depends on what you need to do with the LEDs, though. If you can get away with persistence of vision effects, you can multiplex a small number of LEDs and cycle through them, for instance.

http://www.best-microcontroller-projects.com/led-dot-matrix-display.html

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

\$\endgroup\$
2
  • \$\begingroup\$ Excellent idea, though for ~150 LEDs that'll be at least 10 of the 16 bit ones, would I be able to carry that many instructions over I2C? There's no need for speed (the LEDs are acting as individually accessible lamps) \$\endgroup\$
    – JP.
    Commented Mar 16, 2010 at 10:29
  • \$\begingroup\$ I don't know. You'd have to read the datasheet. That page says you can only use 8 8-bit chips per I2C bus, so you'd need three I2C buses available. Can you put up with lamps flickering so fast they aren't visible? That would allow a much simpler circuit. Even if you need them to be continuously on, if they don't need to switch states very often you can uses latches for a simpler circuit. \$\endgroup\$
    – endolith
    Commented Mar 16, 2010 at 15:27
2
\$\begingroup\$

To do this you'd be better to investigate shift registers which would let you control many leds from a couple of pins this is the first example I came accross

http://www.instructables.com/id/LED-matrix-using-shift-registers/

\$\endgroup\$
2
\$\begingroup\$

See these three previous questions about controlling a large number of LEDs from a single microcontroller:

Yes they mention arduino in the questions, but the answers apply to whatever microcontroller you are using.

\$\endgroup\$
0
\$\begingroup\$

XMOS chips are used for driving large LED arrays. They are used in conjunction with Macroblock shift registers.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.