Muxing 7-segment Displays - Page 1
Forum section: electronics / projects

author: NivagSwerdna
author_rank: Super Contributor
timestamp: May 24, 2022, 07:40:41 pm
content: I have a 4 digit seven-segment display which I arranged as two pairs (that was determined by the number of IOs I had going for this purpose)So essentially I have a pair of pairs.I need to multiplex within the pairs...How fast should I do that? Do I need an off time between the on times?

author: edavid
author_rank: Super Contributor
timestamp: May 24, 2022, 07:53:39 pm
content: I would recommend segment resistors so you can control the segment current.If you're doing that, it probably makes sense to do 4 way multiplexing, so you only need one set of resistors. (But if you do 2 way multiplexing, you only need 2 digit driver transistors.)Refresh rate is whatever avoids flicker. Anything higher than 200Hz should be fine. Try waving your hand in front of the display.You probably won't need any dead time.

author: Kleinstein
author_rank: Super Contributor
timestamp: May 24, 2022, 08:09:41 pm
content: Depending on the required brightness (depends on the environment) and the displays one can get away with 4 way multiplexing. So it is a good idea to first do a test with a few segments with a constant current to see what current is actually needed. This can vary quite a bit (e.g. 1 mA to > 100 mA) from easy allowing multiplexing even with more than 4 digits to not possible even without multiplexing.A short dark phase can help, especially if the FET switching is slow or delayed from the segment update. It usually only take a short dark phase, like a µs. Even relatively short overlap and just the capacitance can result in slight leakage to the next digit.

author: Benta
author_rank: Super Contributor
timestamp: May 24, 2022, 08:14:16 pm
content: Yeah, do 4-way muxing instead.That'll save you 6 I/Os and 8 resistors.I recommend dead time for the cathodes to avoid ghosting. 10 us is plenty, but depends on your timer/firmware routine. It takes the switching times of the MOSFETs and the servicing of your ports out of the equation. 200 Hz or more is fine for mux frequency.Also, why 4 MOSFETs + resistors? Drop in a ULN2003 and you're done. You might be able to use the remaining three drivers for something else.

author: Zero999
author_rank: Super Contributor
timestamp: May 24, 2022, 08:32:26 pm
content: Yes, do away with the 4 way multiplexing.For future reference, if you all you need is two digits, one of the transistors can double as an inverter, saving an output pin.

author: CaptDon
author_rank: Super Contributor
timestamp: May 24, 2022, 08:46:50 pm
content: I am muxing nixies in a 1 of 6 array. The scan oscillator runs at 300 Hz giving a 50 Hz flicker rate, the flicker is slightly noticeable at times. I am not using any dead time. My scan is right to left. Using the russian nixie driver I.C. there is a code for 'blank'. If I light only one digit I can see faint ghosting, however when all digits are active ghosting can not be observed. The display looks totally normal. The unit displays +/-,yr,day,hr,min,sec or today a quick glance over shows + 22 144 20 45 38

author: Benta
author_rank: Super Contributor
timestamp: May 24, 2022, 08:51:37 pm
content: Quote from: CaptDon on May 24, 2022, 08:46:50 pmAnd??

author: Peabody
author_rank: Super Contributor
timestamp: May 24, 2022, 08:58:03 pm
content: Or, you could multiplex by segment instead of by digit. If your IO pins can source the current to a maximum of four segments at the same time, then multiplexing by segment would eliminate the segment resistors and the mosfets. But you would have to test it to be sure it's bright enough since a segment is on only 1/7 (1/8 if you're using the DP) of the time instead of 1/4. So basically you turn on one segment line at a time, and bring low the common cathodes of the digits which should have that segment lit up. So the maximum segment line current is four segments, and the maximum common cathode current is only one segment. The total parts count would be four resistors - one in each of the common cathode lines. Almost twice the refresh rate though. If the current load is too high, a 74HC4017 might be used instead to cycle through the segment lines one at a time. If any interest in this option, see here:https://github.com/gbhug5a/7-Segment-Displays-Multiplex-by-Segment

author: edavid
author_rank: Super Contributor
timestamp: May 24, 2022, 09:03:48 pm
content: Quote from: Benta on May 24, 2022, 08:14:16 pmIt depends on the supply voltage though. OP's displays have max segment voltage of 2.6V, and ULN2003 drops 1V.

author: Benta
author_rank: Super Contributor
timestamp: May 24, 2022, 09:19:28 pm
content: Quote from: edavid on May 24, 2022, 09:03:48 pmYou're pulling my leg, right?

author: DavidAlfa
author_rank: Super Contributor
timestamp: May 24, 2022, 10:26:06 pm
content: Get the ULN2003V12, it's mosfet-based, around 2ohms RDS-on in my measurements.Normally you don't really need off time, it's enough with the delay of processing the next display.Don't toggle it at MHz because most of the time will be wasted in the rising and falling edges, 100us on-time per display will give good brightness and completely remove any flickering.Basically the loop would be:- load display data- turn on mosfet- wait 100us...1ms- turn off mosfet- Clear display data, will reduce chance of ghosting effect, you might omit this step.- repeat with the next displayThen test the displays with "8 . 8 . "If you see any traces of the "8" in the ".", It might be too fast, try adding 1us delay after turn-off, increase if necessary but shouldn't need a lot.100us will give a refresh rate of 2.5KHz, you can go slower if required, but as mentioned, better keep it over 200Hz or so (1.25ms/display).If interrupt-based, 500Hz is a good value.But as always, better you do it, play with different delays and check the result!

author: mariush
author_rank: Super Contributor
timestamp: May 24, 2022, 11:09:45 pm
content: If you have pcb space, it may be cheaper and easier to just get some shift registers or linear led drivers ... you shift the bits for each segment and then switch all with one signal.Here's example of classic shift register converted to driver for leds... you can set the maximum segment current with a single resistor, and you can chain these chips to handle more digits :https://lcsc.com/product-detail/LED-Display-Drivers_MBI-MBI5124GP-B_C256866.htmldatasheet is in english so it's easy to understand it.LCSC has also segment led drivers ... for example see chips like TM1620, 8 segment x 6 digits for 26 cents, 27k pieces in stock though notrecommended for new designs :https://lcsc.com/product-detail/LED-Display-Drivers_TM-Shenzhen-Titan-Micro-Elec-TM1620_C19579.htmlor this GN6128 with 7k in stock , 10segment x 7 digits or 13 segment 4 digits AND key matrix scanner :https://lcsc.com/product-detail/LED-Display-Drivers_GN-Semic-GN1628_C265469.htmlor 8 x 4 driver :https://lcsc.com/product-detail/LED-Display-Drivers_UMW-Youtai-Semiconductor-Co-Ltd-ET6226M_C347308.html

author: NivagSwerdna
author_rank: Super Contributor
timestamp: May 25, 2022, 09:29:23 am
content: For a bit of context... I am driving this from ICE40UP5K-SG48ITR i.e. ice40UP FPGA, this is my first time using this part so I may have got a few things wrong!According to the datasheet a LVCMOS 3.3 pin can source or sink 8mA max. (section 4.17 of the family datasheet). I couldn't find a total current limitation in the data sheet.As for pins... I have enough spare that I can afford the arrangement above and I thought it would be flexible but the suggestions above are appreciated.

author: TomS_
author_rank: Frequent Contributor
timestamp: May 25, 2022, 09:54:15 am
content: Timing wise, I have a project which multiplexes 3 rows of a display at 1ms intervals - that is, each row is only illuminated for 1ms out of every 3.The display is fine when looking at it, there is no flicker (to my eyes anyway, apparently some people can be more sensitive to this kind of thing?), but if I move my eyes back and forth quickly I can notice the underlying multiplexing effect.

author: Kleinstein
author_rank: Super Contributor
timestamp: May 25, 2022, 10:01:32 am
content: With a limited drive capability it may be good use the original planed 14 segments x 2 groups multiplexing, despite of needing more resistors.With a relatively low voltage FETs for switching are better and for only 2 or 4 channels there is lettle gained in using a UNL2003 or similar.To a certain degree one can add an extra off phase to reduce the intensity if needed.There is no need to get more than 200 Hz refresh rate. Faster scanning only increases EMI problems.

author: NivagSwerdna
author_rank: Super Contributor
timestamp: May 25, 2022, 06:36:55 pm
content: I went for 183Hz and it seems OK. It might be a little dim so I will have to consider driving it a little bit harder. (To be expected... I think these things really like 20mA continuous to be bright)PSI'm starting to see the attraction of those display drivers... although I really would like something I could source locally.

author: DavidAlfa
author_rank: Super Contributor
timestamp: May 25, 2022, 07:35:01 pm
content: Check theAIP650, $0.085 in low quantities ($0.05 for 500qty), multiplexes 4 segments, uses i2c bus, also allows keypad matrix scanning.Hard to beat that for 8 cents!

author: edavid
author_rank: Super Contributor
timestamp: May 25, 2022, 07:52:03 pm
content: Quote from: DavidAlfa on May 25, 2022, 07:35:01 pmYou mean 4 digit, 8 segment.It would be nice to have an English datasheet though.

author: mariush
author_rank: Super Contributor
timestamp: May 25, 2022, 07:58:43 pm
content: Not quite local, but Digikey has chips like IS31FL3728 , which can do programmable 8×8, 7×9, 6×10, 5×11 matrix :https://www.digikey.com/en/products/detail/lumissil-microsystems/IS31FL3728-QFLS2-TR/5319755Also has audio input, and can do fancy brightness effects based on audio input but that can be disabled through i2c commands.Relatively cheap at $1.26 each or under 1$ for 25+There's also the more classic "shift register like" drivers with 16+ channels, with added 256 brightness levels per channel, max current set through one resistor etc etcIS31FL3235A , 28 channels for $1.9 :https://www.digikey.com/en/products/detail/lumissil-microsystems/IS31FL3235A-QFLS2-TR/7219609IS31FL3208A, 18 channels :https://www.digikey.com/en/products/detail/lumissil-microsystems/IS31FL3208A-QFLS4-TR/12675554IS31FL3218 : 18 channels :https://www.digikey.com/en/products/detail/lumissil-microsystems/IS31FL3218-GRLS2/5319748You could also use 2 cheap and simple 16 channel drivers and use only 28 out of 32 "channels".

author: DavidAlfa
author_rank: Super Contributor
timestamp: May 25, 2022, 08:52:33 pm
content: Quote from: edavid on May 25, 2022, 07:52:03 pmYep, I meant 4 digit, excuse me, brain damage lol

author: CaptDon
author_rank: Super Contributor
timestamp: May 26, 2022, 04:34:07 pm
content: And?And I was giving the original poster the results In some detail of my experience including the ghosting factor and how mine was a 1 of 6 array and what the scanning speed was and the flicker factor at that speed. Granted mine are nixies and his is seven segment but the basics are similar enough that I wanted to share the results as food for thought? AND?? There ain't no AND. The statement was already a complete thought. Included was a statement about the faint ghosting because I did not include dead time between digits but when the leading zeros were not blanked the ghosting was not objectionable leaving the O.P. with the conclusion he may not need dead time during the scan. AND??? What?? How about your thoughts? Maybe just show me the results of your muxed display so the O.P. can learn from your observations also.

author: Benta
author_rank: Super Contributor
timestamp: May 26, 2022, 06:33:59 pm
content: You posted about Nixies. Period.How is the OP going to use that info for his LEDs? Does he know anything about how Nixies work? How fast/slow they are? How they are driven?Your story/anacdote-telling derailed the thread. THAT's why you got the "And?" from me.

author: BrianHG
author_rank: Super Contributor
timestamp: May 26, 2022, 06:48:45 pm
content: Quote from: Benta on May 24, 2022, 08:14:16 pm10us dead time? What in the world... I have done 400ns (2 op-codes on a PIC microcontroler) dead time without any ghosting. 1us should be fine and allow less dimming if you choose to use a higher refresh rate.

author: Benta
author_rank: Super Contributor
timestamp: May 26, 2022, 07:03:21 pm
content: What's wrong with the word "plenty"? And turning around the ports on an MCU can indeed be fast, but if C++ and RTOS are involved perhaps not.I only wanted to indicate that it's pretty uncritical.