Getting Started with the MAX7219 Eight Digit 7-Segment LED Driver

westaust55

Moderator
Publishing/Posting of this tutorial has been delayed for a while (I was going to post in late December 2012) but other matters arose.

The MAX7219 7-segment LED driver chip has been around for a while now and there have been several recent posts where forum members have sought assistance.

This tutorial will hopefully help those who, at a future date, wish to use the MAX7219 7-Segment LED driver for the first time.

EDIT:
Tutorial updated to Rev D as the Clock and Load signals in the schematics were swapped (and did not match the program code)
 

Attachments

Last edited:

westaust55

Moderator
Getting Started with the MAX7219 Eight Digit 7-Segment LED Driver - more demo code

Here is the 18M2 and 40X1 demo program code.

EDIT:
I should highlight that the 40X1 code will work with very few changes (just alter you IO pin designations) on a X2 part.
 

Attachments

Last edited:

John West

Senior Member
Thanks, Westy. It's always a pleasure reading your comprehensive tutorials. We don't pay you nearly enough. :)

One suggestion though, you might want to mention right off that the MAX2219 is good only for common cathode displays. A lot of new users might not catch that point right off and may not know that such displays come in two different flavors.
 
Last edited:

westaust55

Moderator
One suggestion though, you might want to mention right off that the MAX2219 is good only for common cathode displays.
A lot of new users might not catch that point right off and may not know that such displays come in two different flavors.
Your wish is my command (well on this occasion at least ;) ). I had also spotted a number of typo errors :(
Somehow I lost or mis-filed the final word documents so have had to reconstruct for Rev B and hopefully have not introduced any new errors.

Rev B has been uploaded at post 1 since we are still on the same page of this thread.
 

westaust55

Moderator
If you need 5 digits on your 7-Segment LED display which rules out the use of a SAA1064 4-digit i2c driver chip (costing about $3-20 as at Mar 2013) and don’t want the higher cost of the 8-digit SPI based MAX7219 (costing about $8-50 as at Mar 2013) then an option is the Motorola MC14489 which is an SPI comms based chip for common cathode displays costing about $3-20 as at Mar 2013.

If decimal places are not required, it is even possible to achieve a 5 and a ½ digit display drive where the most significant digit is just 0 (blank) or 1.

There are some other differences:

In decode mode the “character set” is extended from the 15 characters the MAX7219 can display (0 to 9 H, E, L P and ‘-“) to the MCC14489 range comprising the hexadecimal digit range (0 to 9 and A, b, C, d, E and F), plus 15 other upper/lower case letters/symbols.

The undecoded mode is less capable as only the LED segments ”a” to “d” are available thus only 20 discrete LEDs can be controlled in undecoded mode.

Intensity is limited to two levels set with one control bit with an approx 2:1 LED current ratio. Low brightness has a current of the order of 6-9 mA and high brightness has a current of the order of 13 to 17.5 mA.
 

slurp

Senior Member
Weataust,

Thanks again - Variations on a theme with a 3D print...

https://vimeo.com/152847272

I've already started to improve the print but you'll get the idea. I'm guessing that a 32mm 8x8 matrix is about as small as we can reasonably attempt a word clock. This one will get to the nearest 5 minutes. I've worked out minutes for setting, there's a corner blink for seconds (or working indication) and Hour / Minute for setting - loads of code to go beyond display and I'm intending to use a Real Time Clock module to help keep time.

The model will appear on Thingiverse soon, looks like a 15 minute print for this matrix. I'm likely to scale up for clearer presentation - depending on what's in my bit-box.

Best regards,
Colin
 

barneydog

Member
Hi,

sorry to bring up an old thread, which has been really informative. Thank you.

I'm trying to make a 9x5 matrix and want to use the MAX7219

I planned to use A,B,C,D,E to run eight leds and then have F run the last five.

Is it possible to run only five on one output if the others are running 8?

Expect there is a very simple answer to this, but just not getting my head round it
 
Top