EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: t1d on June 03, 2020, 03:34:13 am

Title: RGB LED- Most Often Common Anode, Over Cathode... But Why? SOLVED
Post by: t1d on June 03, 2020, 03:34:13 am
I'm just starting to research RGB Led/MCU projects. I was fortunate to realize, before placing an order, that they come in two flavors... Common Anode and Common Cathode.

That led to the question of which to use with MCU projects... The answer I keep finding is that it is best to use Common Anode. When asked as to why, the response is "Because that is the way most Arduino code is written."

I find that to be a shallow answer... The why of it is, IMHO, more likely hardware constraints, than coding convenience. So, I would appreciate your efforts to educate me, please and thank you.

Two points - I am accustomed to working with PICs and I am a novice coder of C.

I greatly look forward to your reply.
Title: Re: RGB LED- Most Often Common Anode, Over Cathode... But Why?
Post by: Paul Moir on June 03, 2020, 03:53:31 am
I think you can blame the 7447 LED Display Driver (http://www.ti.com/lit/ds/sdls111/sdls111.pdf?ts=1591155527770).  TTL devices in this family could sink (take into an output) much more current than they could source (get out of an output).  The 7447 is no exception.  In fact if you look at the schematic of the outputs you'll see it can't source any current at all.  It can only sink current through it's NPN output transistor which is in an "open collector" configuration.  Since the 7447 can only provide a current sink for the segments, they must necessarily be common anode.

The open collector configuration is convenient for other reasons.  It can allow a voltage higher than the chip's VCC appear on the segment drivers when they are off.  So you could conceivably drive a display that is powered by more than 5 volts.

Most modern MCUs and logic chips have totem-pole outputs which can source as much as they can sink, so the choice now is arbitrary.  But you'll see that on a lot of old schematics and it has become a habit to sink current into devices rather than source from the device.
Title: Re: RGB LED- Most Often Common Anode, Over Cathode... But Why?
Post by: greenpossum on June 03, 2020, 04:07:08 am
For small current displays it doesn't matter, but when the displays are higher current and/or involve a string of LEDs, you often see that a transistor is used to switch the high end (which may not be 5V) because the peak current in multiplexing is higher than what most MCUs can drive. The cathodes however often stay within the typical 20mA limit of port pins. But there are many exceptions. I just wish both varieties of displays and driver chips were equally available so that I can choose the most appropriate drive configuration.
Title: Re: RGB LED- Most Often Common Anode, Over Cathode... But Why?
Post by: basinstreetdesign on June 03, 2020, 04:10:35 am
... they come in two flavors... Common Anode and Common Cathode.

That led to the question of which to use with MCU projects... The answer I keep finding is that it is best to use Common Anode. When asked as to why, the response is "Because that is the way most Arduino code is written."

I find that to be a shallow answer... The why of it is, IMHO, more likely hardware constraints, than coding convenience.

You are a discerning person.

The answer to that question has some history behind it.  About 50 years of history.  Indeed, common-anode displays are more common because it was more convenient from a hardware standpoint to drive them that way.  So most displays were made that way and most SW (what there was of it 50 years ago) was written to support that.

The dominant hardware technology then was TTL which was designed with a much stronger output LOW drive capability than an output HIGH drive capability.  Since LED displays with a common pin for anode (or cathode) would conduct much more current through the common pin than any of the individual cathodes (or anodes) and since that common pin would conduct much more current than even a LOW TTL gate could suck down that common pin was connected to a digit strobe transistor to turn the digit on.  Also, since TTL had a (fairly) strong pull-down output structure, it would be able to strongly turn on a PNP digit strobe transistor connected to Vcc and that would then pull UP that common anode.  That TTL output was connected to the base of said PNP.

So, since this was the dominant technology for about 20 years through the late 1960's through the mid 1980's, everything that interfaced with those displays also had to handle them in a common-anode manner.  And since all of those bits of hardware had to do that then all of the software needed to conform as well.  This has persisted all the way to current days.

Going a bit further, most logic devices that were manufactured to be part of a uP/uC system in the 1980's through the 2000's were made compatible with the ubiquitous TTL as far as HIGH and LOW logic levels and the inertia for that technology trend has persisted, as well into this century.
Title: Re: RGB LED- Most Often Common Anode, Over Cathode... But Why?
Post by: T3sl4co1l on June 03, 2020, 05:55:57 am
It's still true today, albeit to a lesser degree -- in Si CMOS, the N-ch is about 2.5 times higher performance than P-ch, thus die area is saved using N-ch sinks.

Proportionate area is required in P-ch, for sourcing equal total currents to the anodes, of course.  This might be external, in discrete transistors or an array, so it doesn't affect the matrix driver at least.  Obviously, this argument fails for fully integrated matrix drivers, which need the full area of both types!

Incidentally, I once drove a 8x8 red LED matrix direct from a pair of 74LS273s, no resistors; worked just fine, the pull-ups being effectively current-limited due to their kinda boosted-passive-pullup output stage.  Intensity didn't seem to vary much with the number of segments lit, which doesn't so much imply anything about the circuit (one lone segment should be sinking a solid 20mA or so, while all eight in parallel should be sinking maybe 3-4mA each, tops?), as about human visual sensitivity, which is insensitive to modest changes in brightness.

Tim
Title: Re: RGB LED- Most Often Common Anode, Over Cathode... But Why?
Post by: Warhawk on June 03, 2020, 06:04:17 am
89C51 / AT89C2051 - look how GPIOs were implemented. It was quite common back then.
Title: Re: RGB LED- Most Often Common Anode, Over Cathode... But Why?
Post by: t1d on June 03, 2020, 06:22:31 am
Excellent answers, each and everyone! Thank you for your efforts to point me in the correct direction.

I had considered that...
1) it might be because a MCU can, generally, sink more current than it can source and
2) that it might be easier/cheaper to drive it with a NPN whatever on the low side.
It is good to confirm that; thank you.

And, the history of it all is quite interesting. Continuing to make Common Anode a bit more of the norm just means that we are creatures of habit.

Because of your good instruction, I can configure a circuit design as best makes sense, without fear of making a basic mistake. I appreciate it.
Title: Re: RGB LED- Most Often Common Anode, Over Cathode... But Why?
Post by: Brumby on June 03, 2020, 12:13:30 pm
Continuing to make Common Anode a bit more of the norm just means that we are creatures of habit.
Not really.

It just means we are creatures of least resistance.  Why push for an alternative when there is a perfectly functional option available - usually with variants and a history to give confidence in reliability.