Monday, July 22, 2013

AVR Atmega MAX7219 7-segment / led matrix display driver library

The MAX7219/MAX7221 are compact, serial input/output common-cathode display drivers that interface microprocessors to 7-segment numeric LED displays of up to 8 digits, bar-graph displays, or 64 individual LEDs.

MAX7219 can refresh leds reducing the micro utilization.
This library use 3 ports to control MAX7219 ic. It can control more than one ic, without the need of SPI. User can setup scan limit, intensity and other parameter of the ic.

Setup parameters are stored in file max7219.h

This library was developed on Eclipse, built with avr-gcc on Atmega8 @ 1MHz.


  • read risk disclaimer
  • excuse my bad english


  1. Hi! I'm using the same LED modules and ATMega644PA. I've built your example code (unmodified) using Atmel Studio 6. Unfortunately, something is wrong and pixels "run" only by 1st line of each module... Can you help?

    1. Hello, this project is compiled with avrgcc, as far as i know Atmel Studio run avrgcc as default compiler, so it should not be the compiler the source of your problem. So, double check your wiring, and check that you are running the micro at the proper speed, check fuses. If those check passes, check with a logic analizer, what's going on the input pins of the MAX7219. If you do not have a logic analizer, import a uart library, and debug using some uart output to your terminal.

    2. Hello, have you try all the suggestions I've tell on the comment above here?

  2. Really thanks for the blog and the code :)

    Good luck,

    1. Thank you for your comment. You are welcome :)