Author Topic: Muxing 7-segment Displays  (Read 1935 times)

0 Members and 1 Guest are viewing this topic.

Offline NivagSwerdnaTopic starter

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Muxing 7-segment Displays
« on: May 24, 2022, 07:40:41 pm »
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?



 

Offline edavid

  • Super Contributor
  • ***
  • Posts: 3383
  • Country: us
Re: Muxing 7-segment Displays
« Reply #1 on: May 24, 2022, 07:53:39 pm »
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.
« Last Edit: May 24, 2022, 08:00:45 pm by edavid »
 
The following users thanked this post: NivagSwerdna

Offline NivagSwerdnaTopic starter

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: Muxing 7-segment Displays
« Reply #2 on: May 24, 2022, 07:56:28 pm »
 :)

 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14192
  • Country: de
Re: Muxing 7-segment Displays
« Reply #3 on: May 24, 2022, 08:09:41 pm »
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.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5870
  • Country: de
Re: Muxing 7-segment Displays
« Reply #4 on: May 24, 2022, 08:14:16 pm »
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.
« Last Edit: May 24, 2022, 08:18:16 pm by Benta »
 
The following users thanked this post: NivagSwerdna

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19514
  • Country: gb
  • 0999
Re: Muxing 7-segment Displays
« Reply #5 on: May 24, 2022, 08:32:26 pm »
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.
 
The following users thanked this post: NivagSwerdna

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 1740
  • Country: is
Re: Muxing 7-segment Displays
« Reply #6 on: May 24, 2022, 08:46:50 pm »
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
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5870
  • Country: de
Re: Muxing 7-segment Displays
« Reply #7 on: May 24, 2022, 08:51:37 pm »
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

And??
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2000
  • Country: us
Re: Muxing 7-segment Displays
« Reply #8 on: May 24, 2022, 08:58:03 pm »
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

 

Offline edavid

  • Super Contributor
  • ***
  • Posts: 3383
  • Country: us
Re: Muxing 7-segment Displays
« Reply #9 on: May 24, 2022, 09:03:48 pm »
Drop in a ULN2003 and you're done. You might be able to use the remaining three drivers for something else.

It depends on the supply voltage though.  OP's displays have max segment voltage of 2.6V, and ULN2003 drops 1V.

 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5870
  • Country: de
Re: Muxing 7-segment Displays
« Reply #10 on: May 24, 2022, 09:19:28 pm »
Drop in a ULN2003 and you're done. You might be able to use the remaining three drivers for something else.

It depends on the supply voltage though.  OP's displays have max segment voltage of 2.6V, and ULN2003 drops 1V.

You're pulling my leg, right?
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5898
  • Country: es
Re: Muxing 7-segment Displays
« Reply #11 on: May 24, 2022, 10:26:06 pm »
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 display

Then 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!
« Last Edit: May 24, 2022, 10:44:29 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5022
  • Country: ro
  • .
Re: Muxing 7-segment Displays
« Reply #12 on: May 24, 2022, 11:09:45 pm »
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.html
datasheet 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 not
recommended for new designs : https://lcsc.com/product-detail/LED-Display-Drivers_TM-Shenzhen-Titan-Micro-Elec-TM1620_C19579.html

or 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.html

or 8 x 4 driver : https://lcsc.com/product-detail/LED-Display-Drivers_UMW-Youtai-Semiconductor-Co-Ltd-ET6226M_C347308.html
 
The following users thanked this post: johnboxall, thm_w, edavid, NivagSwerdna, retiredfeline

Offline NivagSwerdnaTopic starter

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: Muxing 7-segment Displays
« Reply #13 on: May 25, 2022, 09:29:23 am »
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.
 

Offline TomS_

  • Frequent Contributor
  • **
  • Posts: 834
  • Country: gb
Re: Muxing 7-segment Displays
« Reply #14 on: May 25, 2022, 09:54:15 am »
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.
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14192
  • Country: de
Re: Muxing 7-segment Displays
« Reply #15 on: May 25, 2022, 10:01:32 am »
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.
 
The following users thanked this post: NivagSwerdna

Offline NivagSwerdnaTopic starter

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: Muxing 7-segment Displays
« Reply #16 on: May 25, 2022, 06:36:55 pm »
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)



PS
I'm starting to see the attraction of those display drivers... although I really would like something I could source locally. 
« Last Edit: May 25, 2022, 06:57:16 pm by NivagSwerdna »
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5898
  • Country: es
Re: Muxing 7-segment Displays
« Reply #17 on: May 25, 2022, 07:35:01 pm »
Check the AIP650, $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!
« Last Edit: May 25, 2022, 07:36:35 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: edavid, retiredfeline

Offline edavid

  • Super Contributor
  • ***
  • Posts: 3383
  • Country: us
Re: Muxing 7-segment Displays
« Reply #18 on: May 25, 2022, 07:52:03 pm »
Check the AIP650, $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!

You mean 4 digit, 8 segment.

It would be nice to have an English datasheet though.
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5022
  • Country: ro
  • .
Re: Muxing 7-segment Displays
« Reply #19 on: May 25, 2022, 07:58:43 pm »
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/5319755
Also 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 etc

IS31FL3235A , 28 channels for $1.9 : https://www.digikey.com/en/products/detail/lumissil-microsystems/IS31FL3235A-QFLS2-TR/7219609
IS31FL3208A, 18 channels  : https://www.digikey.com/en/products/detail/lumissil-microsystems/IS31FL3208A-QFLS4-TR/12675554
IS31FL3218 : 18 channels  : https://www.digikey.com/en/products/detail/lumissil-microsystems/IS31FL3218-GRLS2/5319748

You could also use 2 cheap and simple 16 channel drivers and use only 28 out of 32 "channels".
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5898
  • Country: es
Re: Muxing 7-segment Displays
« Reply #20 on: May 25, 2022, 08:52:33 pm »
You mean 4 digit, 8 segment.
Yep, I meant 4 digit, excuse me, brain damage lol
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 1740
  • Country: is
Re: Muxing 7-segment Displays
« Reply #21 on: May 26, 2022, 04:34:07 pm »
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.
 
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5870
  • Country: de
Re: Muxing 7-segment Displays
« Reply #22 on: May 26, 2022, 06:33:59 pm »
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.
 

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 7732
  • Country: ca
Re: Muxing 7-segment Displays
« Reply #23 on: May 26, 2022, 06:48:45 pm »
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.

10us 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.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5870
  • Country: de
Re: Muxing 7-segment Displays
« Reply #24 on: May 26, 2022, 07:03:21 pm »
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.

« Last Edit: May 26, 2022, 07:05:21 pm by Benta »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf