0
\$\begingroup\$

So I know to drive a 7-segment display you need a TON of pins. However there are 7-segment display drivers (such as the MAX7219) that seem pretty popular.

However I'm looking at the datasheet, and am a bit confused. (https://datasheets.maximintegrated.com/en/ds/MAX7219-MAX7221.pdf). It mentions the SEG A-G connecting to the obvious segments of the 7-segment display (AND2307SLC mentioned in the datasheet)...but what exactly are the DIGI 0-7 for then? (But then on page 13 it shows them actually connected.)

Maybe I'm a bit confused how it works exactly. From my vague understanding we send it serial data to the DIN pin of what segment we want to display, and it outputs that to SEG A-G. (We send 16 bits, and it only looks at the last 4 correct?) (BTW this makes me not understand what LOAD is for exactly.)

And then there is decode mode, which I guess is the main way to turn on digits via serial as opposed to just turning them on via DIG7-DIG0.

Am I even on the right track on this? I'm just a bit confused how it all works together. Also I'm curious how it handles turning on multiple segments when doing it via serial. Is it storing something in SRAM and then uses some sort of timer/refresh to keep the digits on?

Thanks, it's just sort of an interesting chip that I'd like to learn more about.

\$\endgroup\$
  • 1
    \$\begingroup\$ The digit pins go to the common cathode pins of 7-segment displays, or an 8x8 matrix. The Segment pins go to the anode of the 7-segments, or an 8x8 matrix. Segment pins are driven high to reflect the #/letter to be displayed, than a digit pin goes low to turn on one of the 7-segments, or a column of an 8x8 matrix. Turn off cathode drive, repeat for next group. \$\endgroup\$ – CrossRoads Dec 19 '18 at 17:30
  • \$\begingroup\$ But the 7-segment displays only have 1 cathode (or common anode) right so you would only need one of them correct for a single 7-segment display? \$\endgroup\$ – msmith1114 Dec 19 '18 at 20:37
  • 1
    \$\begingroup\$ Yes. A multi-digit display would have the segments to all displays in common (As, Bs, Cs, etc) and then 1 digit line for each digit's common cathode to enable it. So a 4-digit display would have at least 12 pins (ABCDEFG-DP) and 4 CC pins. (and sometimes there are 2 CC pins per digit, and maybe another pair of pins for a : that is not part of any digit for a clock) \$\endgroup\$ – CrossRoads Dec 19 '18 at 20:40
  • 1
    \$\begingroup\$ "We send 16 bits, and it only looks at the last 4 correct?) (BTW this makes me not understand what LOAD is for exactly." I hope the answers below address this? Treat LOAD like chip select. You always send 16 bits - 8 are the address of the register, 8 are the data going into the register. \$\endgroup\$ – CrossRoads Dec 19 '18 at 20:45
1
\$\begingroup\$

The functional diagram on p5 shows 5 registers including a MODE Register that defines how the chip interprets incoming data.

In direct segment "mode", the CODE B ROM would be bypassed for direct control from the SIPO register ( serial in, par. out) to the segment driver.

In normal segment decoder "mode" the values of each digit are stored in dual port SRAM and the digits are MUX'd from 1 to 8 digits as preselected to select both the Digit drivers and SRAM registers.

Current limits of an LED have a Max peak and continuous rating so neither must be exceeded , considering that the average brightness is controlled by Rset and PWM as well as the the average duty cycle determined by the number of digits.
enter image description here

The common cathode digits are driven low with a low voltage drop switch, while the anode segment is +ve current regulated for each digit.

This also poses a challenge for LED suppliers to have sufficient brightness when +ve pulsed at the defined current limit with 1/8 duty cycle without fusing the junction from excess current density. This is also physically connected by an almost visible gold whisker wirebond. There inlies the tradeoff to peak current and size of the wirebond.

If the demand is more than 40mA then external segment driver is needed.

\$\endgroup\$
2
\$\begingroup\$

Look at the functional diagram of the datasheet you posted.

Each digit of the display has eight LEDs, with either all of their cathodes or all of their anodes tied together (the driver will say whether it's common cathode or common anode). Each segment of each digit has their other side tied together. This lets the driver turn on each digit in turn, to show the desired pattern on the segments.

The communications to the driver uses synchronous serial. You shift in bits using the DIN and CLK. Google "SPI" for how that works if it's not familiar to you.

Those bits are completely ignored by the rest of the device until you drive *LOAD low. At that point the bit pattern is interpreted as eight bits to write and an address -- those eight bits go into the 8x8 dual-port RAM (and it looks like you can do some setup, too).

There's a lot of stuff going on inside that part. Expect to do some close studying of the data sheet before you get it all figured out.

\$\endgroup\$
1
\$\begingroup\$

The MAX7219 muxes at 800 Hz, so to the human eye the groups of 8 LEDs all appear to be on at once. When you transfer a byte into a data register, the new contents show up at the output. Writing to a register is pretty simple:

digitalWrite (ssPin, LOW);
SPI.transfer (registerAddress); // from 1 to 8 for the display outputs.
SPI.transfer (dataToDisplay);
digitalWrite (ssPin, HIGH);

Very easy. Do the same for the 5 control registers (in setup() for an Arduino for example).

Intensity (brightness) - typically the only one you'd change on the fly as well.

Scan (3 to 8 digits typically).

Normal/Shutdown.

Test (turns on all LEDs).

Decode mode (used to map 0-9, H,E,L,P to 7-segment display; or make up your own font mapping).

\$\endgroup\$
  • \$\begingroup\$ I used 4 chips and an Arduino to make this 8 x 32 display youtube.com/watch?v=hwYqgyMc5S4 I had a 32 byte array that held the mapped message and sent the contents to the 4 chips every 100mS. 40-50mS was about the fastest I could update and still have the message be readable. Took me three tries to get the wiring straight. The first time, I didn't realize they were 2-color displays, so got done with 16 wires, and still had 8 pins left! Then the second time, I had the parts rotated 90 degrees. 3rd time I finally got it all aligned correctly so that byte0 aligned with column0. \$\endgroup\$ – CrossRoads Dec 19 '18 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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