| MD_MAX72xx LED Matrix Arduino Library 2.4 Library to control connected MAX72XX devices as a pixel array

- Main Page
- Related Pages
- Classes
- Files

All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
System Connections

## Connections to the Arduino Board (SPI interface)

The modules are connected through a 4-wire serial interface (SPI), and devices are cascaded, with communications passed through the first device in the chain to all others. The Arduino should be connected to the IN side of the first module in the chain.

The Arduino interface is implemented with either

- The hardware SPI interface, or
- 3 arbitrary digital outputs that are passed through to the class constructor.

The AVR hardware SPI interface is fast but fixed to predetermined output pins. The more general software interface uses the Arduino shiftOut() library function, making it slower but allows the use of arbitrary digital pins to send the data to the device. Which mode is enabled depends on the class constructor used.

The Arduino interface is implemented with 3 digital outputs that are passed through to the class constructor. The digital outputs define the SPI interface as follows:

- DIN (MOSI) - the Data IN signal shifts data into the display module. Data is loaded into the device's internal 16-bit shift register on CLK's rising edge.
- CLK (SCK) - the CLocK signal that is used to time the data for the device.
- LD (SS) - the interface is active when LoaD signal is LOW. Serial data are loaded into the device shift register while LOAD is LOW and latched in on the rising edge.

The LD signal is used to select the entire device chain. This allows separate LD outputs to control multiple displays sharing the same DIN and CLK signals. The software needs to instantiate a separate object for each display.

The remaining interface pins are for +5V and GND. The power supply must be able to supply enough current for the number of connected modules.