• (Row, Col) Designates an LED at a particular row and column, following the convention set by the datasheet
  • {Anode, Cathode} Designates a anode/cathode pair to light an LED in the array
  • Assume that I've connected:
    SEG_DP to pin 13
    SEG_A to 3
    SEG_B to 11
    SEG_C to 10
    SEG_D to 6
    DIG_0 to 9
    DIG_1 to 14
    DIG_6 to 2

Suppose I'm interested in lighting (1,1). By the convention, I would have to source current to pin 13 and sink current from pin 9. What two bytes should I send to the MAX7221 to achieve this?

My Attempt:
I think it should be 0x01 and 0x80 (0000|0001|1000|0000) with MSB (D15 as it is referred to in the datasheet for MAX7221) on the far left. Code I tried using is below as an image. I checked the signals with a logic analyzer and verified that the SPI protocol was followed (I forgot to take a screenshot but I will provide one when I get a chance). The LED array did not behave as I had anticipated. All LEDs in the matrix were lit!


  • 1
    What about using a library? playground.arduino.cc/Main/LEDMatrix has a few. Even if you prefer to write your own code you should be able to find a few hints there. – fuenfundachtzig Mar 9 '15 at 9:14
  • Add a delay after setting the SS low. Also specify try adding PI.setDataMode(SPI_MODE0); and/or SPI.setClockDivider(SPI_CLOCK_DIV8); – Gerben Mar 9 '15 at 12:56
  • can you explain the clock divider function? For reference, the MAX runs at 10Mhz and the MCU that I'm using (Arduino Uno) runs at 16Mhz – Minh Tran Mar 9 '15 at 21:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.