If you need assistance, please send an email to forum at 4hv dot org. To ensure your email is not marked as spam, please include the phrase "4hv help" in the subject line. You can also find assistance via IRC, at irc.shadowworld.net, room #hvcomm.
Support 4hv.org!
Donate:
4hv.org is hosted on a dedicated server. Unfortunately, this server costs and we rely on the help of site members to keep 4hv.org running. Please consider donating. We will place your name on the thanks list and you'll be helping to keep 4hv.org alive and free for everyone. Members whose names appear in red bold have donated recently. Green bold denotes those who have recently donated to keep the server carbon neutral.
Special Thanks To:
Aaron Holmes
Aaron Wheeler
Adam Horden
Alan Scrimgeour
Andre
Andrew Haynes
Anonymous000
asabase
Austin Weil
barney
Barry
Bert Hickman
Bill Kukowski
Blitzorn
Brandon Paradelas
Bruce Bowling
BubeeMike
Byong Park
Cesiumsponge
Chris F.
Chris Hooper
Corey Worthington
Derek Woodroffe
Dalus
Dan Strother
Daniel Davis
Daniel Uhrenholt
datasheetarchive
Dave Billington
Dave Marshall
David F.
Dennis Rogers
drelectrix
Dr. John Gudenas
Dr. Spark
E.TexasTesla
eastvoltresearch
Eirik Taylor
Erik Dyakov
Erlend^SE
Finn Hammer
Firebug24k
GalliumMan
Gary Peterson
George Slade
GhostNull
Gordon Mcknight
Graham Armitage
Grant
GreySoul
Henry H
IamSmooth
In memory of Leo Powning
Jacob Cash
James Howells
James Pawson
Jeff Greenfield
Jeff Thomas
Jesse Frost
Jim Mitchell
jlr134
Joe Mastroianni
John Forcina
John Oberg
John Willcutt
Jon Newcomb
klugesmith
Leslie Wright
Lutz Hoffman
Mads Barnkob
Martin King
Mats Karlsson
Matt Gibson
Matthew Guidry
mbd
Michael D'Angelo
Mikkel
mileswaldron
mister_rf
Neil Foster
Nick de Smith
Nick Soroka
nicklenorp
Nik
Norman Stanley
Patrick Coleman
Paul Brodie
Paul Jordan
Paul Montgomery
Ped
Peter Krogen
Peter Terren
PhilGood
Richard Feldman
Robert Bush
Royce Bailey
Scott Fusare
Scott Newman
smiffy
Stella
Steven Busic
Steve Conner
Steve Jones
Steve Ward
Sulaiman
Thomas Coyle
Thomas A. Wallace
Thomas W
Timo
Torch
Ulf Jonsson
vasil
Vaxian
vladi mazzilli
wastehl
Weston
William Kim
William N.
William Stehl
Wesley Venis
The aforementioned have contributed financially to the continuing triumph of 4hv.org. They are deserving of my most heartfelt thanks.
Registered Member #1232
Joined: Wed Jan 16 2008, 10:53PM
Location: Doon tha Toon!
Posts: 881
Hi and seasonal greetings to all,
Here's a quick question for the electronics designers here, and those who frequently drive lots of LEDs from microcontrollers etc...
Almost all of the examples of LED multiplexing from microcontrollers that I can find online and in service manuals of commercial equipment show the common-anodes (matrix column connections) of the LEDs being driven from the positive supply rail via PNP transistors operating in common-emitter mode. These boost the available current from the microcontroller I/O line to support the sum of all of the possible LED currents on that column. For example:
My question is why are PNPs used in common-emitter mode when NPNs would seem to be a better choice operating in emitter-follower mode?
Eg:
I know that the saturation voltage of a PNP in common-emitter is lower than the 0.7v drop of an NPN operating as an emitter-follower. However in LED driver applications operating from 5v or more you still have to drop a few volts across the LED's current limiting resistor anyway, so you might as well drop 0.7v of it across the transistor and adjust the resistor calculation accordingly.
For all commerical projects i've done to date I have just copied the norm and used PNP transistors to drive the common-anode columns with the appropriate base resistors. This has generally worked well. However, on a few occasions I have had to add "dead-time" delays into the multiplexing software to allow time for one column transistor to turn off before changing the row data in order to prevent ghosting.
It seems to me that NPN transistors operating in emitter-follower mode would switch faster, are often cheaper and also don't need resistors to limit their base currents. So I am left wondering why this arrangement isn't the norm for multiplexed driving of panel LEDs in typical embedded control applications.
Registered Member #2099
Joined: Wed Apr 29 2009, 12:22AM
Location: Los Altos, California
Posts: 1716
Hi. Has it been a while since you've posted here?
The NPN emitter follower has no current gain to speak of, so its digital input needs to source the entire anode current for as many segments as are lit. It (the uC output port) probably has non-negligible output impedance, especially when sourcing rather than sinking. So the voltage would drop & brightness would be change according to the number of segments. [edit] As 2Spoons pointed out, that's just plain wrong. My bad; must remember to engage brain before shifting fingers into gear.
The PNP saturated switch requires much less base current, and its V_CE varies little with load current.
Registered Member #2099
Joined: Wed Apr 29 2009, 12:22AM
Location: Los Altos, California
Posts: 1716
2Spoons wrote ... Rubbish. An emitter follower has current gain set by the Hfe of the transistor. It's voltage gain is unity.
Right you are, 2Spoons. I spoke in haste, and was just plain wrong, and regret it. On a non-technical note, you mistakenly put an apostrophe in its.
>>In the NPN case its across emitter-base, which can usually only handle ~5V of reverse bias.
Hey wait a minute, how does the emitter follower config ever reverse bias the EB junction? Are you talking about the brief period at turn-off, when the load (selected LEDs and series resistors) doesn't pull the NPN emitter down far enough and fast enough to keep up with the base?
I think the OP did mention that the NPN emitter-follower wastes some supply voltage. Weren't the original multiplexed LED displays found in early-1970's pocket calculators, with NMOS LSI chip sets and perhaps with 2.4-volt batteries for power?
Registered Member #72
Joined: Thu Feb 09 2006, 08:29AM
Location: UK St. Albans
Posts: 1659
It might be a hang-over from when the world was TTL, when, to within an order of magnitude, logic only sank current and never sourced it, and a logic '1' was anything above 2.4v on a 5v rail. In these CMOS days, outputs are more symmetrical, but even so, NPN structures are still better than PNPs, so rail to rail outputs still tend to sink a little better than they source.
This means is that it was easier to sink current out of a PNP hanging on the +ve rail, than it was to source current into an NPN follower and get a decent voltage out to drive the LEDs. The readily available rows decoders, see 74LS138 for instance, always had active low outputs, which reinforced this preference.
Anybody making new stuff, even to take advantage of new technology which overcomes former disadvantages, will have a tendency to follow in the wheel ruts of the old for compatibility, or familiarity of the users.
Registered Member #816
Joined: Sun Jun 03 2007, 07:29PM
Location:
Posts: 156
I did think about the reverse bias, but this will be shared over the led and the transistor b-e junction when the row is high and column select low, unless the driver/microcontroller is using open collector outputs. Probably isn’t going to be a big problem at just 5v though.
Pnp drivers would really be an advantage if you were using a higher supply voltage or a different supply rail for the for larger size displays, as driven from an open collector would do the level shifting aswell.
Voltage drop is probably the most significant reason though, particularly as Dr. Slack mentioned if your logic high is not quite equal to +5v in the first place, and those green / yellow leds have a higher forward voltage drop again.
Registered Member #1232
Joined: Wed Jan 16 2008, 10:53PM
Location: Doon tha Toon!
Posts: 881
Thanks to everyone for their thoughts.
Neil, I suspect you've hit the nail on the head with the reasons for most equipment being designed the traditional way with common-emitter stages. I hadn't thought about TTL outputs that struggled to get close to the +ve rail when outputting a logic '1'. In this case PNP common-emitter stages would work better. They would also be a good choice if using white LEDs where a much larger voltage needs to be dropped across the LED.
Steve, thanks for the vote of confidence...
"It turned out that I have done it with the emitter followers before! Nothing bad happened."
That's what I was hoping someone was going to say!
My proposed "LED and switch matrix" looks very much like yours except that:
1. I'm going to use one common set of eight "row lines" from the micro to support both driving a matrix of LEDs and also reading a matrix of switches.
2. There will be three column lines for driving LEDs through NPN emitter-followers, and three un-buffered column lines for driving the diode/switch matrix.
The only added complication is flipping the eight port lines used for the rows between inputs and outputs during the multiplexing to support reading the switches and driving the LEDs. I'll spend as little time as possible reading the columns of switches in order to keep the duty ratio for the LEDs sensible, and keep the LEDs as bright as possible for a given peak current stress.
This site is powered by e107, which is released under the GNU GPL License. All work on this site, except where otherwise noted, is licensed under a Creative Commons Attribution-ShareAlike 2.5 License. By submitting any information to this site, you agree that anything submitted will be so licensed. Please read our Disclaimer and Policies page for information on your rights and responsibilities regarding this site.