Shop OBEX P1 Docs P2 Docs Learn Events
Is this circuit drivable by a Propeller? - Page 2 — Parallax Forums

Is this circuit drivable by a Propeller?

2»

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2008-11-29 13:21
    If you connect your leds to ground so that the prop sources current then that current MUST come from the prop's VDD supply. If you are driving them hard or you have many leds then that "could" cause a problem with the prop itself. When I say I "favor" something it usually means that I have found that there are advantages following this course.

    Most of my 3.3V regulators are tiny SOT-23 jobs that I can position them around the board as necessary but most of the time there is only a single 3.3V regulator. Depending upon my calculations of worst case conditions, even momentary, then I may opt for additional regulators. The most important one is the one that runs the prop because if you allow even the most transitory event to upset the supply to the CPU then you have compromised your whole design.

    Whereas many boards may be designed with one big 3.3V regulator I can see no benefit from putting all your eggs in one basket as I don't save any pcb "real-estate" nor do I have better regulation than if I have multiple regulators. So this is the approach I "favor", there are good reasons just as insurance policies are taken out "just in case" so I build in insurance into designs. Most of the time you don't need insurance but when you do you are glad you paid those premiums. For hobbyist designs or quick & dirty prototypes it doesn't matter but for production it is very important as any "glitches" can prove to be the undoing not just of a product but of a whole company.

    The mention I made of being able to drive blue leds was really just an extra reason why it might be more advantageous to sink to +5V or a different regulator rather than source from the prop's 3.3V. Really it's about not just blindly hooking up things just because they can work that way. I know full well that many newer CMOS structures can source as well as they can sink unlike many of the older processes but that does not mean that there is nothing more to consider than this simple criteria.

    BTW, the prop never sees (you know, what can be measured from that perspective) +5V at it's I/O pin because that +5V is dropped by at least 1.6V which means that the maximum that the prop could see is really 3.4V (< VDD+0.3V). So theoretically you could hook-up an led which had a voltage drop of 4V to a supply of 7V. Usually I have +5V available from a tiny switch-mode supply that is quite happy to provide at least 500ma with barely a struggle even from inputs supplies over 30V so why put in a big 3.3V regulator and introduce more noise on the prop's VDD when it makes so much sense to do it the more efficient way.

    A red led at very very low currents will have a typical forward voltage drop of around 1.6V, once you really light it up it probably has a drop of around 1.8V. Except for IR leds all the other leds have higher voltage drops than the red led.
    A blue led needs at least 3.4V or so but you need "headroom" to regulate the current properly through the resistor which means you are going to need at least 4V or so.

    There is no difference whichever way you hook them up as you can turn them on and off easily it's just that sinking involves writing a logic low to the pin to turn it on whereas sourcing involves writing a logic high.

    Advantages of sinking leds from +5V

    * Smaller 3.3V regulator possible (or larger regulator avoidable) or less heat dissipation
    * Able to handle blue and white leds
    * Less noise or droop on prop's supply (don't feed the gremlins)


    Advantages of sourcing leds (when +5V is available)
    * ?

    *Peter*

    P.S. Saw your pdf Jay and there is all there is to it and certainly the only way you can drive blue leds directly.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-11-29 19:15
    Jay,

    Here are some schematics showing various LED drive situations. The large rectangular block shows the output structure of one Propeller pin. The arrows indicate internal and external current flows.

    attachment.php?attachmentid=57015

    Figure a) shows your current-sourcing circuit. Current flows into the Propeller via the Vdd (+3.3V) pin, through the PMOS drive transistor, out the port pin, sourcing current to the LED, thence to ground via the current-limiting resistor.

    Figure b) shows a current-sinking circuit. Current flows from +V through the LED via the resistor, into the port pin, which is sinking the current to ground via its NMOS drive transistor and its Vss pin. When you have an LED with a high forward voltage, +V can be higher than Vdd, so long as +V - Vdd < Vfwd for the LED at all but the most miniscule currents.

    Figure c) demonstrates what can happen when the conditions of b) are not met. Here Vfwd < +V - Vdd - 0.6V. (The 0.6V is the forward voltage of the internal "protection" or substrate diode.) In this case, even with the pin as an input, current flows through the LED from +V to Vdd, possibly causing a faint glow.

    You still haven't said what the purpose of your LEDs is, although the 1K resistors in your schematic hint that they're just indicators. At such low currents, there's no advantage in having separate regulators for the LEDs. You will get more output from blue LEDs if you use the circuit in b) with +V = 5V. But I've successfully driven a blue LED using your schematic iwth a 100-ohm limiting resistor. The voltage accross the LED was 3.0V, leaving 0.3V across the resistor, for a current of 3mA.

    Frankly, except for the higher voltage requirement of blue LEDs and the possibility of driving them from 5V, I see no advantage of current-sinking over current-sourcing. With current-sinking, just as much current has to flow through the Prop's Vss pins as flows through its Vdd pins in a sourcing situation. High transient ground currents (which cause "ground bounce") are just as troublesome as high transient Vdd currents. They have to flow through the same tiny gold wires to get from lead frame to silicon; and from the chip's point of view, the result is the same: a temporarily lower supply voltage. But you don't have high currents in your design. As long as you use plenty of filtering and bypassing, along with a sensible layout, you should have no trouble.

    So, my questions to you, to help wrap this thing up are:

    1. What are the LEDs being used for?

    2. Why blue LEDs?

    3. What's the part number for the LEDs? Can you link to a datasheet?

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Just a few PropSTICK Kit bare PCBs left!

    Post Edited (Phil Pilgrim (PhiPi)) : 11/29/2008 9:59:49 PM GMT
    807 x 367 - 8K
  • Jay KickliterJay Kickliter Posts: 446
    edited 2008-11-30 13:14
    Phil, you're right. Thery're just idicator lights. I am using blue LED's, but just dimly lit would be fine. The reason for blue is that I hate red and green LED's. I don't even have a plan for them, but I had a few open pins on the Prop. I already got one board made, my first PCB, but this one should fix all the little mistakes I made in the first.

    The digikey part number for the blue LED's I'm ordering is: 751-1093-ND, the data sheet is here: www.vishay.com/docs/83016/tlhb440.pdf.

    Peter and Phil, thanks a lot. You guys did a much better job of explaining sourcing/sinking than anything I was able to find on the Web.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-11-30 17:06
    Jay,

    The LED you've chosen has a high enough forward voltage that you will want to use the current-sinking circuit with a +5V feed. According to the Ifwd vs. Vfwd graph (figure 4 in the datasheet), at about 3.4V the LED draws less than 1mA. The graph doesn't extend below that, so it's hard to say what happens at a lesser voltage. Of course, you could always use an insignificant series resistance, effectively driving it with 3.3V. But I'd be more inclined to drive it from 5V (figure b, above: +V = 5V) with, say, a 680-ohm series resistor. That will give you about a 3mA drive, according to the graph.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Just a few PropSTICK Kit bare PCBs left!
Sign In or Register to comment.