0
\$\begingroup\$

Is it possible to control say up to 4 seven segments displays using a single microcontroller and having some I/O ports left?

For example, say I would like to show a reading with 4 seven segments displays using a driver like MAX7219. Do I need a driver for each display? Can I control all the segments using just one driver and SPI communication with the microcontroller?

More generally, I'm asking what is the industry standard way of doing this which I guess uses the minimum number of components. I know it is possible to build an analogue circuit to drive each segment, use an EEPROM, use a driver for each display, etc... but I am looking for a way that uses the least number of components.

\$\endgroup\$
10
  • 5
    \$\begingroup\$ Are you aware of the idea of multiplexing? \$\endgroup\$
    – brhans
    Aug 15, 2019 at 12:55
  • \$\begingroup\$ @brhans not applied to seven segments displays. Can you show different numbers on different displays by multiplexing? \$\endgroup\$
    – mickkk
    Aug 15, 2019 at 12:56
  • 4
    \$\begingroup\$ @vangelo And probably costs more than the rest of the BOM together. $10 at Digikey right now, each piece carefully hand-bonded with gold wires by the Pope during a full moon. Plus Maxim aren't exactly famous for maintaining reasonable prices over time. \$\endgroup\$
    – Lundin
    Aug 15, 2019 at 13:06
  • 2
    \$\begingroup\$ But why would you need a chip! Microcontrollers were invented many decades ago and this is very basic stuff. Even I would be able to make the design and then I'm a software guy. \$\endgroup\$
    – Lundin
    Aug 15, 2019 at 13:13
  • 1
    \$\begingroup\$ Also there are 7-seg in dual or quad packs, reducing the number of signals needed significantly. \$\endgroup\$
    – Lundin
    Aug 15, 2019 at 13:15

4 Answers 4

3
\$\begingroup\$

You can multiplex displays, however there is a limit to how low the duty cycle can get without adversely affecting the brightness. That limit depends on how good the displays are (brighter more efficient LEDs generally cost more) and the specs of the LEDs (max peak current) and how bright your display needs to be visually, so it varies with the application, but typically 1/4-1/8 is about as far as you want to go.

Minimum component count might be a goal in small-volume applications such as oddball instrumentation, but for high volume applications, it's usually cost that is minimized.

If you're a hobbyist, then something like the MAX7219 which will control 8 digits might be a choice, especially since there are probably Arduino or whatever libraries available so that the effort is minimized. Genuine ones are pretty expensive, far too expensive for many volume applications. I believe there are cloned ones out there. You can use one or more and select using the /CS lines.

The more usual approach in volume applications is to use the microcontroller as the display controller and add some inexpensive drivers. The consumption of microcontroller bandwidth is pretty small (maybe a couple percent for an 8-bit microcontroller) provided the timer interrupts can be serviced with small enough jitter to prevent visual flickering of the display (probably a +/- a handful of microseconds will suffice). The number of I/O can be handled by picking the microcontroller for that characteristic or by adding expanders or shift registers or demultiplexers (for digit selection). You could also use a small CPLD, which tend to excel in having lots of I/O vs. cost, but that requires device programming and writing the code in the first place.

Generally speaking, the optimum trade-offs will vary with each and every design.

\$\endgroup\$
5
  • \$\begingroup\$ Note that for large segment displays (eg: 20mm) a micro-controller might not be capable of supplying enough current. \$\endgroup\$
    – Jeroen3
    Aug 15, 2019 at 13:13
  • 1
    \$\begingroup\$ @Jeroen3 "drivers" are usually required. Sometimes the microcontroller can handle the segments, so only digit drivers are required. Maybe both in some cases, but in my experience that's the exception and results in poor quality displays (varying segment brightness with pattern so an '8' is dimmer than a '1'). \$\endgroup\$ Aug 15, 2019 at 13:16
  • \$\begingroup\$ You can also use 74HCxxx serial to parallel converters for the drivers, one per digit. If you use the common ones the digits get scrambled during an actual write, but if you write fast enough (they're compatible with SPI) you can't see it. \$\endgroup\$
    – TimWescott
    Aug 15, 2019 at 15:06
  • \$\begingroup\$ @TimWescott The ubiquitous 74HC595 has an output latch so you can write info into the SR at your leisure and just latch it in with a clock edge. \$\endgroup\$ Aug 15, 2019 at 15:10
  • 1
    \$\begingroup\$ @SpehroPefhany I'm getting old. It wasn't available from DigiKey or Mouser in 1989, when I was designing the radio for my Master's thesis. That has a pair of 74HC164's in it, and the display visibly glitches when you change channels. \$\endgroup\$
    – TimWescott
    Aug 15, 2019 at 16:17
0
\$\begingroup\$

I believe the standard way would be to use a multiplexer that can act as the signal switcher between your microcontrollers IO output pins and the display driver. Your multiplexer will just have to run at a multiple of your IO pin output signal to cover the 4 panels instead of one.

\$\endgroup\$
0
\$\begingroup\$

I'm not sure if there is an industry standard, but I would power the 7-segs one display at a time, cyclically, fast enough for the eye not to notice any flicker. This can be done with a mux, or buffer IC, or 4 BJT or 4 MOSFET (if sufficiently fast) etc etc. Some MCUs may be able to drive the LEDs directly from I/O pins.

The segment lines are preferably connected to shift registers, one per 7-seg. Daisy-chain the shift registers and control it all through SPI.

There's no need for strange Maxim circuits.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ That's called "multiplexing". It would enhance your answer quite a bit if you'd put it in there, then anyone reading this will have the right search term. \$\endgroup\$
    – TimWescott
    Aug 15, 2019 at 15:04
  • \$\begingroup\$ @TimWescott Not really. The idea is to have a SPI Daisy-chain, and then drive the displays as needed, not necessarily through a mux. It's all too vague what hardware the OP got though, one has to start with the nature of the 7 seg displays. Are they individuals or is it a quad array etc. \$\endgroup\$
    – Lundin
    Aug 16, 2019 at 6:49
0
\$\begingroup\$

The idea is multiplexing.

If you want to control 8 digits, you use 16 digital pins (8 for each segment, 8 for each digit).

If you want to control more, than instead of connecting these 16 pins directly to the MAX7219, use e.g. 8 MAX7219 ICs and multiplexer ICs to decide which MAX7219 is active. Assume you use a CD4051 (8 channel multiplexer), you can use 16 of them and put them after each output pin. This way you can drive 8 (multiplexer channels) * 8 (digits/MAX7219) = 64 digits.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.