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:
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:
| Symptom | Likely cause |
|---|---|
| Part of the display stays dark | MAX_DEVICES too small |
| Everything lit, nothing readable | HARDWARE_TYPE wrong |
| Whole display blank | power, or VCC on 3.3 V |
| Random garbage that comes and goes | logic 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
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.
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 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.
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.
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
Questions about this product
See what other owners have asked, and read their solutions.
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.