Shop OBEX P1 Docs P2 Docs Learn Events
Multiplexing Help — Parallax Forums

Multiplexing Help

MRMR Posts: 46
edited 2007-10-14 15:24 in BASIC Stamp
Hello,


I have 40 led displays, Common Anode. All 7 segments A-G are wired in parallel, i.e. All A's wired together, all B's, C's, D's, E's F's, G's. The 7 segments are connected to a 7447 BCD to 7 Seg Decoder to reduce the I/O Lines needed, and I use a binary nibble. I have been trying to multiplex the displays by turning each display on for a small amount of time then turning it off and going to the next display. Currently I use All the available pins on the Basic Stamp 2P40 and it works Great with 15 displays, but I need a way to control the other 25 displays with one Basic Stamp. What I am looking for is a way to turn on and turn of each display in SEQUENCE so that I can multiplex 40 Common Anode seven segment displays without sacrificing every single input pin on the stamp, and a way that uses minimal amount of pins perhaps a serial connection using shift registers. I was thinking about cascading shift registers to turn on each display in sequence using shiftout, I don't know if that will work, and then there is the question of getting the right amount of amperage so that the displays are bright enough. I would greatly appreciate any suggestions.

-MR

Post Edited (MR) : 10/13/2007 9:37:25 AM GMT

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-13 15:22
    Have a look at the 74HC595 serial-out shift register. There are examples of its use in the StampWorks manual and in a Nuts and Volts column on expanding I/O. It typically requires 3 I/O pins and provides 8 logic outputs (and is cascadable for more).

    You will likely need buffering on the decoder (or multiple decoders) and the serial shift register to get the kind of current you'll need for multiplexing that many digits. If you're mostly happy with the brightness with 15 displays, you'll probably be ok with the brightness for 20 displays without significant changes. You could use two 7447 decoders (on 8 pins) plus 20 pins for the selectors and do two displays at a time with a total use of only 28 I/O pins. Don't forget that both the Stamp I/O pins and the 7447 output pins have current limits on them on the order of 20ma.
  • MRMR Posts: 46
    edited 2007-10-13 22:47
    Thanks Mike.

    If both the 7447 and the stamp have 20ma current limit, how would I boost the current to get good brightness?
    I thank you for your help.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-13 22:58
    You need some kind of power transistor or MOSFET. There are diagrams and descriptions in the StampWorks manual and the Industrial Control tutorial, both of which you can download. For the switched anodes, you would need a PNP transistor or a P-channel MOSFET. For the switched cathodes, you would need an NPN transistor or an N-channel MOSFET.
  • MRMR Posts: 46
    edited 2007-10-14 05:13
    Thank You Mike. I will get to work and let you know how it works.

    MR
  • JSWrightOCJSWrightOC Posts: 49
    edited 2007-10-14 15:24
    I would try using a binary to one-of-x decoder circuit. Faster than a shift register, and since you need to address each one individually then you would need a 1-of-40 select. You could optionally drive this with a binary counter as well, needing only two lines - one for clock, one for reset.

    That brings up another question. 40 displays means that each display will be having 1/40th (2.5%) of the current drive as its average. To achieve 6mA average current per display, that would be a whopping 2.4A of segment drive - check your data sheets, that may not be feasible. Also that's a lot of time consumed on your Stamp program - have you tested it to verify that it scans fast enough to meet persistence of vision requirements?

    Maxim makes some nice LED driver chips, that will multiplex several displays together. There are ones available with parallel and serial interfaces. I believe some are cascadeable. You might look into using a few of those to drive your displays instead - that would free up your Stamp's CPU cycles to do a lot of other stuff!
Sign In or Register to comment.