Interchangeable 7 segment display - CA and CC - Page 1
Forum section: electronics / beginners

author: Yaroooo
author_rank: Regular Contributor
timestamp: June 18, 2019, 08:10:30 am
content: In my application, I should control 4 display composed of 7 segments. I want to use a classic method with 4 BJT and segments all driven by a Micro. An update rate will show up each value on the powered display.Particularly is that I'd like to have the possibility to interchange between Common anode screen and Common Cathode.Is there an optimized or right way to do that?Here's my BJT tests, power supply is a single buck regulator that regulates form 24v to 5v. There's a resistor on each port that goes from my Micro (PIC16F15354) on a single segment bus. Display models are SC15-11SRWA and SA15-11SRWA.In the Test 1, all were fine, I've tested both CA and CC displays without problems, One were brighter than other because a voltage drop on BJT when used with LEDs between emitter and ground.On test 2, only CC display works, but no light on CA.What is wrong?I've suppose that is something related to voltage drop on BJTs and Forward Voltage, but on my first board (3 in total) all worked perfectly. On a new board (exactly the same but with new BJT configuration to reduce jumpers), I've 2 assembled two of them but only CC screens are working.

author: Zero999
author_rank: Super Contributor
timestamp: June 18, 2019, 10:09:17 am
content: I can't see any of the images because they're blocked by the firewall. Please attach them here.No, common anode and common cathode LED displays are not interchangeable. For common anode, the four transistors need to switch the anode, connected to the positive supply voltage and the logic of the MCU output to each segment needs to be reversed.Trace the current flow, from the MCU output, though the current limiting resistor, the LED and transistor and you'll see what I mean. Look up the schematics for the common anode and cathode LED displays, if needs be.You could use eight transistors (four NPN and four PNP) controlling the anode/cathode of the LED display and reverse the logic of the output, in software, but you'll need a way to identify what type of display is connected to the output.

author: Yaroooo
author_rank: Regular Contributor
timestamp: June 18, 2019, 12:43:10 pm
content: Quote from: Zero999 on June 18, 2019, 10:09:17 amI've changed images link. Now you should see them.I know the display type mounted, in this case. And the FW will adapt based on which display will be mounted, so CA or CC will be driven by a sink or source pin output configuration. Jumpers on BJT, that is fixed, will interchange wires to VCC or GND.Worked till now with TEST 1 board. But on TEST 2 board doesn't work anymore. What I'm asking to myself is if I was lucky in the first case. Since both schematics are same. The only difference is pin on my gate resistor that have two BJTs instead a single one. Already performed a cut test to exclude one, but nothing.

author: Zero999
author_rank: Super Contributor
timestamp: June 18, 2019, 01:01:55 pm
content: If you've fitted both the PNP and NPN transistors, then they will both turn on, short circuiting the power supply and most likely be destroyed as soon as power is connected to the circuit. The base connection is a low impedance diode. Connect a PNP and NPN transistor like this and a very high current will flow directly from the PNP transistor's base, through the NPN transistor's base.The solution is to only fit either the PNP or NPN transistors.If you can redesign the board, configure the transistors as emitter followers: NPN to the positive and PNP to the negative, reduce the LED current limiting resistor values slightly (I assume they're on another schematic) and it should work.Another possibility is to replace the NPN BJTs with N-MOSFETs and PNP BJTs with P-MOSFETs (gate to base, drain to collector and source to emitter, connections), which have a high impedance gate connection and won't blow up like this, but you need to find parts with the correct pin-out to avoid redoing the board.

author: Yaroooo
author_rank: Regular Contributor
timestamp: June 18, 2019, 02:29:34 pm
content: Quote from: Zero999 on June 18, 2019, 01:01:55 pmOn schematics I've SOT (with double bjt package) NPN connected to a common side of the diode through a jumper. But only one will be closed. So I should never have a short circuit.This give me an idea, use the same configuration and package but with a component that have a PNP-NPN BJTs inside, maybe in this case I'll reduce Vce since I'll use my BJTs in correct way.My supposition is that, since SC version have a lower Vf, I don't have any problem.In case of SA, SA15-11SRWA have this specifics:Vf min 3.7 - Vf max 5.0(I've tried also to unsolder and resolder a working display from test 1 board to test 2, but nothing)

author: Zero999
author_rank: Super Contributor
timestamp: June 18, 2019, 03:41:14 pm
content: Ok, I see the problem now, sorry I got confused with PNP and NPN transistors.I can see why this isn't working now and no, there is no short circuit which will damage the transistors.I Googled the data sheet for the BC817 and it became obvious to me why the common cathode works, but not the common anode. I was on the right track with the base-emitter diode issue.The common anode is an emitter follower configuration, which needs to have the full LED voltage on the base, plus about 0.6V to work.The common cathode is a common emitter configuration. The diode junction in the BJT is clamping the voltage to about 0.7V, which is preventing the high side from turning on.You need to change it the base connections, so the lower BJT's base, is not directly connected to the upper BJT's base. The common anode BJT doesn't need a base resistor, because it's configured as an emitter follower, the base current is self-limiting.

author: james_s
author_rank: Super Contributor
timestamp: June 18, 2019, 04:30:11 pm
content: Could you not just use a totem pole follower stage to drive the common pin of the displays? I don't think I've ever tried making an interchangeable board like that but it shouldn't be too hard to do.

author: Peabody
author_rank: Super Contributor
timestamp: June 18, 2019, 04:44:30 pm
content: Depending on the segment current needed, it may be possible to provide for both CA and CC parts (but not mixed) without using any transistors. The choice of CA or CC would be set in software.You would set up the 8 segment drivers just as you have them, but the CA or CC pins would be driven by GPIO pins with only a current-limiting resistor. The key to making this work is to multiplex by segment instead of by digit.In traditional multiplexing, each segment driver provides current to only one segment at any one time, but the CA or CC pin must source or sink current for as many as 8 segments including the DP - hence the need for the transistor.But if you multiplex by segment, each segment driver must supply a maximum of 4 segments at one time, but the CA or CC sources or sinks current for only one segment at a time, and therefore needs no transistor, just a resistor. The question is whether a PIC can drive 4 segments at once, and that depends on how efficient your displays are. But it appears the absolute maximum rating for GPIO pins for the PIC is 50ma, so if you can use 10ma per segment or less, this may work.You would have to refresh twice as often as the traditional method because each segment is ON only 1/8 of the time versus 1/4 of the time when multiplexing by digit, and this will make the digits appear a bit dimmer. But your software would define what GPIO state is "ON" for both the segment lines and the CA/CC lines. They would just be opposites for CA and CC parts. It's even possible that your software could autodetect which displays are being used (I had no luck finding a way to do that, but perhaps your high-voltage-drop parts would provide a way.)This is all explained in detail in this video and the related Github repo.

author: David Hess
author_rank: Super Contributor
timestamp: June 19, 2019, 04:23:20 am
content: Quote from: james_s on June 18, 2019, 04:30:11 pmIn the past totem pole output stages would not meet the current requirements for the common signal of a multiplexed display but today high efficiency displays might make this feasible.QuoteI have seen it done before but I never studied exactly how. The common terminal drive requirements are much greater than the segment terminal drive requirements. So use a discrete driver for the common terminal and a gate output for the segment terminals as is commonly done anyway.

author: Yaroooo
author_rank: Regular Contributor
timestamp: June 19, 2019, 03:38:42 pm
content: Quote from: Zero999 on June 18, 2019, 03:41:14 pmThanks, this solved my problem!