Shop OBEX P1 Docs P2 Docs Learn Events
Question about an example in the SX/B help file — Parallax Forums

Question about an example in the SX/B help file

Timothy D. SwieterTimothy D. Swieter Posts: 1,613
edited 2007-06-24 01:37 in General Discussion
I installed the SX/B package today because I hope to get some of the development tools soon.· I was looking at the time/clock example in the help file.· This example multiplexs the pins on several 7-segement displays.· I understand the logic that is going on in the code.· On the electrical end, it looks like all 7 segments (plus the decimal point) can be on at once meaning a lot of current·will go through the single pin on the cathode - right?·

In the recent issues of Nuts and Volts something similar was done with a PIC, but the code in the article quickly·turn on and back off each segment.·

Any insights·that the community has related to the current draw?· I see the resistors limiting the current.· I have not hooked up a circuit yet,·so I can't say how dim/bright the display is.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter
tdswieter.com
One little spark is all it takes for an idea to explode

Comments

  • JonnyMacJonnyMac Posts: 8,946
    edited 2007-06-22 17:34
    I wrote that program using the components available on the PDB -- it works great. Keep in mind that the displays are in fact multiplexed, so the LEDs are never on 100% of the time. Even if you have all eight LED bits on the duty cycle is a little short of 100% because the blanked in the interrupt before the new segment data is moved into them.

    Assuming a 1.5v forward voltage for the segments the current draw with a 470 series resistor is about 7.4 mA each, 59.5 mA for all eight together -- the SX can handle this.
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2007-06-22 23:21
    Thanks JonnyMac.

    Really 59.5mA? Hmmm....I need to read the datasheet again. I thought I read that each pin can source or sink 30mA so I would have thought a problem would exist. Perhaps the SX is very tough design. I am looking forward to using them.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter
    tdswieter.com
    One little spark is all it takes for an idea to explode
  • JonnyMacJonnyMac Posts: 8,946
    edited 2007-06-22 23:36
    You're right, the SX is a tough bugger; in a production design I'd be inclined to but transistors into the cathode control lines.
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2007-06-22 23:40
    Or multiplex the segments fast enough like the article in June 2007 N&V article that used a PIC. I think the software turned on each cathode and then quckly blinked each segment and then moved on to the next digit. This adds more software, but eliminates the hardware. Of course the digits are not at a full 100% duty cycle, but that may be OK.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter
    tdswieter.com
    One little spark is all it takes for an idea to explode
  • JonnyMacJonnyMac Posts: 8,946
    edited 2007-06-23 00:27
    I haven't seen that article yet -- I'll have a look and adapt the timer example to that strategy; it shouldn't be tough since the SX is like a very fast PIC. The trick is getting the entire display updates at least 20x per second, otherwise the it may appear to strobe.
  • Invent-O-DocInvent-O-Doc Posts: 768
    edited 2007-06-24 00:32
    I was wondering a couple things about this SX/B example as well. I happen to have a bunch of common anode displays, but those look like they will hook up to the example well with inverting the data output logic and maybe putting a transistor on the common anodes so that shouldn't be a problem. The part I'm not so sure of is this:


    1) What's the maximum # of 7-segment displays that can be multiplexed without excessive flickering or dimness?

    2) If I want a 4-6 digit LED display that accepts serial data, can I just use an interrupt and still have things be reliable?
  • JonnyMacJonnyMac Posts: 8,946
    edited 2007-06-24 01:37
    Sure, I did an 8-digit display at the very beginning of the SX/B project: http://www.parallax.com/dl/docs/cols/nv/vol6/col/nv117.pdf.

    Note that this code is very old (SX/B is much cleaner now) and like the help file example, drives the cathodes directly (you may want to use transistors in your design).
Sign In or Register to comment.