Fork me on GitHub

Project Notes

#101 8x8 LED Matrix Raw Drive

Drive an 8x8 LED Matrix with a MAX7219 chip and raw SPI commands.

The Build

Notes

This is a first test of an 8x8 LED module kit from a seller on aliexpress. This is a pretty common device available from many sources, either as prefab module or parts kit.

The kit includes a “1088AS” 8x8 LED module, which is single colour (red) with row pins cathode and column pins anode.

Although it is possible to drive an LED matrix directly, it quickly becomes wasteful of GPIO pins. This kit minimises the pins required by including a MAX7219 Serial-Interfaced LED Display Driver chip. The microcontroller the just needs 3 pins to drive the MAX7219 using and SPI protocol.

There are libraries available to talk to the MAX7219, such as the LedControl library. However this project uses raw SPI just for the sake of developing some familiarity with the operation of the MAX7219. See the LedControlDemo project for a test driving with the LedControl library.

Module Kit Construction

Kit Parts

PCB Front

PCB Back

Kit Completed

Module Connection

The LED module is connected to the Arduino with three pins as follows (in addition to +5V power and ground). The actual Arduino pin used is not significant, although in this example I have used the conventional SPI pins.

Connection Arduino Pin
CS 10
MOSI/DIN 11
SCK/CLK 13

Example Code

Turns out that talking to the array via the MAX7219 is pretty simple! We just shift out a 16-bit command which is latched on the rising edge of the CS clock select pin. Each 16 bits comprises an 8-bit register address and 8 bits of data, which is well described in the datasheet.

See code in the MaxRawDemo.ino sketch demonostrates the bare minimum required to start writing to the display. Next up, I guess I need to get it to display something interesting!

Construction

Breadboard

The Schematic

Credits and References

About LEAP#101 8x8 LEDArduino

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

Project Source on GitHub Return to the LEAP Catalog
About LEAP

LEAP is my personal collection of electronics projects - usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting.

Projects are often inspired by things found wild on the net, or ideas from the many great electronics podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know or send a pull-request.

NOTE: For a while I included various scale modelling projects here too, but I've now split them off into a new repository: check out LittleModelArt if you are looking for these projects.

Project Gallery view the projects as an image gallery Notebook reference materials and other notes Follow the Blog follow projects and notes as they are published in your favourite feed reader