Description
The MAX7219 LED Driver a serially interfaced common cathode LED driver that can drive up to 8 digits of 7-seg LEDs or 64 individual LEDs.
PACKAGE INCLUDES:
- MAX7219 LED Driver
KEY FEATURES OF MAX7219 LED Driver:
- 3-wire SPI serial interface
- Drives up to 8 digits of 7-segment common cathode displays
- Drives up to 64 individual LEDs in up to an 8 x 8 matrix
- 5V compatible
The MAX7219 is designed to drive common-cathode LEDs and is perhaps the most popular of the LED drivers for driving 7-segment, bar-graph and LED matrix type displays with uCs.
The driver provides flexible individual LED segment control as well as basic functions such as turning the display ON/OFF and adjusting the LED brightness. The part is very straightforward to use and only requires one external resistor (RSet) to set the upper current limit for driving the LEDs. Because the chip can switch fairly significant current that will vary depending on the content of the displays, it is recommended that a 0.1uF and 10uF bypass capacitors be placed between power and ground close to the chip to minimize power supply ripple.
The MCU interface is via a 3-wire SPI serial interface. Most MCU have libraries available for this chip that makes it very easy to use. Since the chip handles all the dirty work of driving the LEDs once the MCU tells it what to display, it minimizes the overhead burden placed on the MCU so it can be off doing other things.
The outputs are arranged as 8 x 8 set of rows and columns which allows it to drive up to 8 digits of 7-segment displays, bar graph displays or 64 individual LEDs. Brightness can be controlled via an external resistor or software.
Multiple chips can be daisy-chained together to form larger displays.
When driving higher voltage or current displays than the chip can handle directly, these are often bundled with driver chips such as the ULN2803 as shown in the partial schematic where it is being used to drive large 7-Segment displays that require more than 5V to drive them.
The part is 5V logic compatible. To use with a 3.3V microprocessor will require level translation of the serial interface using something like our logic translation module.
These parts are the DIP version so they are breadboard friendly.
OUR EVALUATION RESULTS:
These are useful ICs and provide an easy way to get alphanumeric or dot matrix displays up and running. These ICs are made in China and are what are used in any of the China made modules that use DIP style MAX7219 ICs.
The program shows an example of using the MAX7219 to drive 8 7-segment displays like the ones we have available below. The wiring schematic is shown to the right. You can click to enlarge.
The program uses the “LedControl.h” library to implement basic functionality of the chip to make it easy to use.
The display is wired to digital pins 5, 6 and 7 but these can be reassigned to any 3 digital pins.
MAX7219 8-Digit 7-Segment Display Module Example Program
/* MAX7219 8-digit 7-segment LED test Basic code for configuring the device and outputting info to the display. Writes 'Arduino' on display and then counts up on the display until "99999999" is reached. Uses the "LedControl" Library which must be included */ #include "LedControl.h" /* Define pins for LedControl. These can be assigned to any digital output pins on a microcontroller. pin 5 is connected to the DataIn pin 7 is connected to the CLK Pin 6 is connected to LOAD / CS The 1 on the end is because we have only a single MAX72XX. */ LedControl lc=LedControl(5,7,6,1); unsigned long delaytime = 500; // delay between character updates long num = 0; // Variable to hold counter number //=============================================================================== // Functions //=============================================================================== // This routine displays a up-counter. This utilizes a clever technique using recursion by // Michael Teeuw http://michaelteeuw.nl/post/158404930702/the-recursive-ledcontrol-counter void showNumber(long number, byte pos = 0) { byte digit = number % 10; lc.setDigit(0,pos,digit,false); long remainingDigits = number / 10; if (remainingDigits > 0) { showNumber(remainingDigits, pos + 1); } } // This routine displays the characters for the word "Arduino" void writeArduinoOn7Segment() { lc.setChar(0,7,'a',false); delay(delaytime); lc.setRow(0,6,0x05); delay(delaytime); lc.setChar(0,5,'d',false); delay(delaytime); lc.setRow(0,4,0x1c); delay(delaytime); lc.setRow(0,3,B00010000); delay(delaytime); lc.setRow(0,2,0x15); delay(delaytime); lc.setRow(0,1,0x1D); delay(delaytime); delay (3000); lc.clearDisplay(0); delay(delaytime); } //=============================================================================== // Initialization //=============================================================================== void setup() { lc.shutdown(0,false); // Wakeup display lc.setIntensity(0,8); // Set brightness to a medium level lc.clearDisplay(0); // Clear the display writeArduinoOn7Segment(); } //=============================================================================== // Main //=============================================================================== void loop() { showNumber(num); num ++; if (num > 99999999) num = 0; // Filled the display so start the count over }
Notes:
- None
Technical Specifications
Maximum Ratings | Operating Voltage | 4.0 – 5.5V |
Supply Current | 330mA | |
Display | Refresh Rate | 800Hz (typ.) |
Segment Drive Source Current | -40mA | |
Package | DIP-24 | |
Package Type | Plastic, thru-hole | |
Mfr | China | |
Datasheet | MAX7219 |