Shop OBEX P1 Docs P2 Docs Learn Events
Question about max electrical output current — Parallax Forums

Question about max electrical output current

CatwareCatware Posts: 14
edited 2005-03-28 20:37 in General Discussion
I have a quick question about the DC characteristics of the SX chip:

According to the specs, the max current into Vss pin is 130mA, and max current out of Vdd is 130mA. Max·sink current per IO pin is 45mA. So I take it·this means that only two pins can receive 45ma? If I were to drive 20 LEDs, one on each pin, they could only receive 130mA/20=6.5mA each (actually less, since the SX itself needs power)? Is a workaround to have 10 of these LEDs sourcing, and 10 sinking, so we could put 45mA on each pin and still keep Vss/Vdd < 130mA?

Also, an unrelated question: When designing machine assembled boards for production runs, at what point do you program the SX? Before sending the SX·chips to the machine assembler, or do you design a few traces into the PCB·to program the SX after the PCB is assembled?

Thanks!

David

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-28 18:43
    The figures you quote are the absolute maximum ratings at which the SX will still operate without failing, you do not want to even·get close to these figures, one small miscalculation or design flaw will burn out your SX. I think the max suggested per pin is 30mA (and only a couple can be driven this heavily), but if your seeking to drive many LEDs, use a transistor or someother means to offload the current draw away from the SX.

    If you are designing a board around the DIP versions of the SX, you can just stick a socket in your PCB, and pull it out to reprogram. If you don't want the hassle of plugging and unplugging the SX or your using a surface mount part you should incorporate a 4 pin header like the one on the tech board to permit in system reprogramming. This is essential during your prototyping phase. If you're in final stage of production, and you are absolutely sure that there will never be a need for a firmware upgrade, you can program the SX before soldering it to your board. But I really suggest incorporating the header into your PCB design because you can never be absolutely certain no modification will be nessesary in the future. If you have any experience with interactions with customers you'll understand this. What the customer says they want, what the designer thinks the customer says they want and what the customer actually wants is never the same thing.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Post Edited (Paul Baker) : 3/28/2005 6:50:02 PM GMT
  • SteveWSteveW Posts: 246
    edited 2005-03-28 19:00
    >but if your seeking to drive many LEDs, use a transistor or someother means to offload the current draw away from the SX.

    Or buying more efficient LEDs may be an option. You get a lot of brightness from a few mA, if you choose carefully. Worth considering, if keeping the circuit simple is vital.

    Steve
  • CatwareCatware Posts: 14
    edited 2005-03-28 19:11
    Thanks for the replies. I am really trying to understand the specs sheet and operation of SX rather than solve a specific problem. I don't actually have an application with 20 LEDs in mind.

    Am I correct in assuming that only two pins can receive 45mA? If we limit to 30mA (your example) then we have 130mA/30mA/pin = 4 pins only?

    Is a workaround to have different pins source/sink at <=45mA so that Vss & Vdd are limited to <130mA?

    Would driving all 20 pins as outputs yield 130mA/20 pins = 6.5mA/pin max?

    And I did have SMT in mind wrt the second question. I mentioned machine assembly, and had in mind productions on the order of 1000 units. I didn't know if it was standard practice to program the chips before assembly, or include traces to attach a programmer after the fact. For instance, you may not want to power the whole circuit after assembly (for whatever reason).
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-28 19:36
    Don't use the 140mA figure, that is the absolute maximum current, driving it at this will dramatically shorten the life of the SX. If you look at the next page under "Supply Current, active" for 5V, 50MHz you see a maximum of 82mA. Dont make a design that exceeds this without expecting repercussions. Taking into account the current consumed by the SX itself, this means no more than 2 pins can be driven at 30 mA.

    If you have a design that will never illuminate more than 2 LED's simulatenously then designing for 30mA per pin would be ok, but really don't try to stress any part beyond its specified limits, your just asking for problems.

    What type of LEDs are you seeking to drive? Most LEDs lifetimes are greatly reduced by the currents your talking about, the only exceptions that I am aware of are high intesity blue or white LEDs and luxeons.

    You can get quite small surface mount transistors to handle the loads for you, just search "transitor array" in digikey. Picking one at random, Panasonic's XN06537 is a dual NPN 30mA transistor in a mini-6P package which has under a 3mm square footprint for $.60 in single quantities.

    If you are going surface mount I would put the header on the PCB and program afterwards, because your going to have to do individual·board testing after assembly anyways, you don't want to have to RMA a bunch of·units because you didn't perform proper fitness tests before shipping. If its critical certain regions of the board remain unpowered, you can segment your supply using a power transistor and/or a jumper.

    If you do programming prior to mounting, your talking about a dedicated programmer having a surface mount ZIF socket, which are expensive if you don't already have access to one. If board area is of concern, then you can install a vertical header rather than the 90 degree variety on the SX tech board.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Post Edited (Paul Baker) : 3/28/2005 7:41:19 PM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-03-28 19:41
    Catware,

    · As a matter of practice, that kind of current is rarely driven directly by the SX (Or any processor) itself, but offloaded onto either discrete components such as Transistors or FETs, or handled by specialty chips, such as the MAX7219 or 74HC595.· This way the chip of component sees the current, and not the SX.

    ··If you should have a need to run multiple LEDs directly from I/O pins, you can always multiplex them to save current draw.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Tech Support
    csavage@parallax.com
  • ForrestForrest Posts: 1,341
    edited 2005-03-28 19:42
    For a 1000 piece run, it would probably make sense to develop some type of computer controlled functional test fixture that programs the SX processor (via spring probes contacting test points), excercises the processor and measures the results.
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-03-28 19:45
    1. It sounds like you are unaware of the dependencies between current, resistance, and voltage. V=IR is ohm's law. It says that Voltage = Current * Resistance. In practice, your Voltage is fixed at 5 volts. Thus, to control Current, you change Resistance.

    There is nothing intrinsically limiting the current. If you connect an SX pin to ground, then try to output +5 volts on that pin, it won't stop at 45 mA. The driver behind the pin will try to drive as much current at 5 volts as it can -- and will then burn out. Forever. It won't 'heal', it will have acted as a fuse and destroyed itself.

    2. So, if you want to drive 8 LED's at 12 mA each, and have all of them on at the same time, you need to use something that can do that. First of all, if you put 5 volts across an LED, it too will act as a fuse (or flash-bulb, actually) and burn itself out. Again, there is nothing intrinsic about an LED that limits the current through it. So you MUST have a resistor in there to limit the current. The equation is (5 volts - 1.4 volts LED voltage) / 15 mA == X. X then is 240 Ohms, or more. If you use a 220 ohm resistor, the equation becomes (5 volts - 1.4 volts LED voltage) / 220 == X, X then is 16.36 mA, which is enough to light most 'normal' LED's to full brightness.· 470 ohms limits to 7.7 mA, which can be pretty good brightness, depends on the LED.

    Now, I understand that a 74HC595 DIP chip WILL drive 15 mA per pin, ALL pins driven, so you could use a '595 to drive your LED's.

    Post Edited (allanlane5) : 3/28/2005 7:47:55 PM GMT
  • CatwareCatware Posts: 14
    edited 2005-03-28 20:06
    allanlane5: I do not see where I asked how to limit the current to a particular level.·I am (was) trying to clarify the spec sheet for the SX. I am not "unaware of the dependencies between current, resistance, and voltage."

    You (and Chris)·mention the 74HC595 IC, which is capable of supplying 15mA to all pins simultaneously. I was only verifying that the SX is *not* capable of likewise doing the same on all 20 of its pins.

    It is still not clear to me if having the SX source 30mA on 10 pins, and sink 30mA on 10 other pins simultaneously would work. I pose this as a theoretical question only; obviously in practice this is an unstable situation to have.
  • CatwareCatware Posts: 14
    edited 2005-03-28 20:19
    Paul: I see the 82mA figure you quote, but suspect that is the current draw the SX itself requires. Evidence: At 4Mhz the spec is 8mA. My guess is that the system does not need to be limited to 8mA draw when using a 4MHz oscillator.

    I'm thinking the table implies you have the following currents available to the IO pins at different XTALs: 75MHz => 130mA-105mA = 25mA; 50MHz => 48mA; 4MHz => 122mA.
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-03-28 20:29
    Yes, correct, the SX cannot supply 15 mA each on all 20 of its pins at the same time. If it 'sources' current with a +5 high through a load to ground, the current to do that comes from the Vdd pin through an SX output transistor. If it 'sinks' current from an external +5 signal through a load to the SX pin to an SX input transistor, the current then goes to the SX 'Vss' or ground pin.

    Either way, you have an SX transistor in there conducting the current (either out of or in to the chip), and trying to dissipate the resulting heat before it melts. That's where the limits come from.

    And I said you "sound" like you were un-aware, since you never mentioned a resistor or current-limiting device in any of your questions. Since this is a typical problem new people have, I just wanted to mention it in case you did have this problem. Since you don't have this problem, it shouldn't be a problem for you.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-28 20:37
    Catware, I think you are correct in your most recent assertion.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sign In or Register to comment.