32×8 matrix/What the chip is doing/07. One column at a time
What the chip is doing · 07 of 10

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.

One column at a time, eight hundred times a second
idle
Scan rate
800 Hz
Columns per square
8
One column's turn
156 µs
LEDs lit at once
8 max
Never more than eight LEDs of a square are on at the same instant. The chip drives one column, moves to the next, and gets round all eight 800 times a second — fast enough that your eye adds them up into a whole letter. It is also why a phone photograph of this display often has dark stripes in it: the shutter was open for less than one full scan, so the camera caught columns that had not had their turn yet. The brightness control is a second, finer chopping on top of this one.

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

Photographs of the display come out with dark stripes

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.

The display flickers when I move my eyes past it

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.

Part of the display is dark and the rest is unusually bright

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.

Does the microcontroller have to keep refreshing it?

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.

Where this goes next

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

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