32×8 matrix/Making it say something/08. When the text comes out sideways
Making it say something · 08 of 10

When the text comes out sideways

A display that is lit, responsive and unreadable is almost never a wiring fault. It is one constant in the sketch, and there are only four values to try.

Why the library has to be told

An 8×8 LED package has sixteen pins and no top or bottom. Whoever designs a driver board decides which way round to solder it and which of the chip's eight digit drivers goes to which row of LEDs. Different manufacturers made different choices, the chip cannot tell, and the library cannot either.

So MD_MAX72XX asks. HARDWARE_TYPE is that answer, and it has four values:

Same data, four ways of being wrong about the board
HARDWARE_TYPE FC16_HW
HARDWARE_TYPE
Wires to change
0
Lines of code to change
1
Rows and columns
as sent
Readable
yes
The right one for this board. Text reads left to right, the right way up. This is the constant for this board. If a display you bought somewhere else comes out looking like one of the other three, that setting is the first thing to change and the wiring is the last.

FC16_HW is the one for this board. If the first upload gives you a display full of readable letters the right way up, you are done and this article is background.

What each failure looks like

The three things that can be wrong are independent, which is why there are four constants and not two:

  • Rows and columns swapped. The message runs down the display in an eight-pixel stripe instead of across it. Very obvious.
  • Column order reversed. Each character is mirrored inside its own square, and the squares themselves may be in the wrong order along the strip.
  • Row order reversed. Letters upside down.

Work through the four constants in order. It takes four uploads and no rewiring, and one of them will be right — these boards are all one of the four.

It is not the wiring

The reason this article exists is that the symptom looks like a hardware fault and is not. A display showing scrambled pixels has power, ground, clock, data and chip select all working — none of that reaches the screen otherwise. The bits are arriving exactly as sent. They are being drawn into a buffer laid out differently from the panel in front of you.

The same logic applies to the other two constants worth suspecting before you reach for a meter:

SymptomLikely cause
Part of the display stays darkMAX_DEVICES too small
Everything lit, nothing readableHARDWARE_TYPE wrong
Whole display blankpower, or VCC on 3.3 V
Random garbage that comes and goeslogic level, or a loose header

Only the last two are hardware, and three and a half volts covers one of them.

When it does not work

The letters run down the display instead of across it

Rows and columns are swapped. Try HARDWARE_TYPE PAROLA_HW or ICSTATION_HW instead of FC16_HW — those two transpose the buffer relative to the panel.

Each character is mirrored inside its own square

Column order is reversed within the square, which is GENERIC_HW's layout. If the characters are readable but appear in the wrong order along the strip, that is the same problem seen at the other scale.

The text is the right way up but the whole message is back to front

The squares are numbered from the other end. In MD_Parola, setZoneEffect with PA_FLIP_LR, or simply turn the board round — the enclosure is symmetrical and the header you wire to is the one marked IN either way.

MicroPython's output is scrambled and there is no HARDWARE_TYPE to set

The max7219.py driver targets the FC-16 layout and has no equivalent setting. It is the right layout for this board. If a different module comes out wrong under it, that module is a different variant and the fix is a different driver, not a different constant.

Where this goes next

Thirty-two columns is four characters. Anything longer has to move, and the number that decides how fast is not the one you would guess.

Scrolling a message

Edit this page — content/books/matrix-32x8/when-the-text-comes-out-sideways.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

Ask a question ↗

32x8 LED Matrix MAX7219, 3-Pack

Loading discussions…

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum