One column at a time
Eight of a square's sixty-four LEDs are lit at any instant. The chip gets round all eight columns eight hundred times a second, which is fast enough for your eye and not always fast enough for a camera.
Eight columns, one at a time
A MAX7219 was designed for eight seven-segment digits. It has eight digit drivers and eight segment drivers, and it lights one digit at a time. On a dot matrix the wiring is the same and the meaning is different: one "digit" is one column of eight pixels, and one "segment" is one pixel in that column.
The datasheet's typical display scan rate is 800 Hz with eight digits scanned, with a specified range of 500 to 1300 Hz. Each column therefore gets about 156 microseconds of every scan and is dark for the rest. Your eye adds them up; it cannot do otherwise at that speed.
What follows from it
Current. Never more than eight LEDs of a square are drawing at once, so a 64-LED display draws about an eighth of what 64 LEDs would. That is what keeps one chip's worst case at a few hundred milliamps rather than a couple of amps.
Brightness. The intensity register chops each of those turns further, from 1/32 of a cycle up to 31/32. Two layers of duty cycle, multiplied.
Cameras. A phone shooting at 1/500 s catches a fraction of one scan, so some columns are lit in the photograph and some are not. This is not a fault in the display or the camera, and it is why product photographs of LED matrices are shot slow.
Scan limit. The register that says how many digits to scan is not a way to
blank part of the display. Scan fewer and the remaining ones each get a longer
turn, so they get brighter — and the datasheet adds that below four digits the
digit drivers dissipate too much and the current-setting resistor ought to
change. Set it to 0x07 on a matrix and leave it alone; to blank part of the
screen, write zeros.
It keeps the picture itself
Each square's eight bytes live in the chip's own memory. Send a frame and the
MAX7219 scans it for as long as it has power, with nothing further from your
microcontroller — which is why the first-light sketch in this book has an empty
loop() and the word stays on the screen.
That is worth remembering when a project is doing something slow. A board busy with Wi-Fi, or asleep, does not make the display flicker or blank. It just stops changing.
When it does not work
The shutter was open for less than one full scan, so the camera caught the columns that had not had their turn. Nothing is wrong. Use a longer exposure — around 1/60 s or slower — and the stripes disappear.
Also the scan, and also normal. At 800 Hz it is well above anything you can see head-on, but a fast eye movement smears the sequence across your retina and you catch it. A higher brightness setting makes it less noticeable.
The scan limit register has been set below 7. Fewer digits scanned means each one gets a longer turn, so the survivors get brighter and the rest go out. The datasheet warns against using scan limit to blank part of a display for exactly this reason — write blank data instead.
No, and that is the whole point of the chip. The eight bytes per square live in the MAX7219's own memory and it scans them on its own. Send a frame, disconnect the data wire, and the image stays.
The one constant that decides whether letters arrive readable, and why it is not a wiring fault.
When the text comes out sideways →Edit this page — content/books/matrix-32x8/one-column-at-a-time.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.