When a digit goes missing
Six symptoms, and one register write that splits them in half. Display test lights every LED regardless of shutdown, intensity and every digit byte — so if it works, stop reading the sketch, and if it does not, stop reading the sketch for the opposite reason.
One write, two halves
Step through the six. Notice that the answer to every one of them is on one side or the other of a single line: is the chip being driven properly, or is it being told the wrong thing?
The write that draws that line is display test, register 0x0F:
// Every LED on, at full brightness, ignoring everything else.
lc.setScanLimit(0, 7);
sendRaw(0x0F, 0x01);LedControl does not expose it directly. lc.setLed, lc.setRow and the rest
all go through the digit registers; display test is a register the library never
writes. Sending it means either dropping to shiftOut yourself or using
lc.clearDisplay plus setRow(0, n, 0xFF) on all eight digits with the decoder
off, which is nearly as good a test and rather more typing.
What makes display test worth the trouble is what it overrides. It ignores the shutdown register, ignores the intensity register, and ignores all eight digit bytes. So it tests exactly the things a sketch cannot get wrong: the supply, the five connections, the joints and the chip.
If it lights everything
The hardware is fine. Every one of the sixty-four LEDs is reachable, the header is soldered, the panels are seated, the supply holds up.
So the fault is in the bytes. In rough order of likelihood:
- Shutdown. The chip powers up blanked and display test lies to you about
this — it overrides shutdown, so a chip that has never had
lc.shutdown(0, false)passes the test and shows nothing afterwards. - Scan limit. One digit lit and seven dark is register
0x0Bat its power-up value. - Segment bit order. Readable but wrong glyphs, on asymmetric characters only.
- CS. A display consistently one write behind is CS not going high.
If it does not
Stop looking at the sketch entirely. In order:
Measure VCC to GND at the pads on the board, not at the other end of the leads. It has to be 4.0 V or more. This catches a lead in the wrong hole, a board being fed from 3V3, and a supply sagging under the load.
Check the pad order against the silkscreen. GND, VCC, DIN, CLK, CS from the corner, printed on the solder side — so with the digits facing you it reads the other way. GND and VCC being adjacent means one position out is 5 V into a data pin.
Look at the joints. A header pressed into the holes rather than soldered is the single commonest fault on this board, and it produces exactly the symptoms that make people rewrite their sketch: digits that come and go, segments lit at random, and a display that works until the desk moves.
Then swap the board. There are three driver boards in the box. Moving the panels to a second one takes five minutes and settles the question of whether the chip is dead, which nothing else will.
The two that are not faults
A display that keeps showing something after your sketch has crashed is working correctly — the eight bytes are in the chip and it goes on scanning them whatever your board does. A frozen display is not evidence that your code is running.
And digits that flicker on camera but not to your eye are the multiplexing, at about 800 scans a second, beating against the shutter. There is no setting for it; the rate comes from the chip's own oscillator. A longer exposure averages it away.
When it does not work
Then the wiring, the supply and the chip are all fine and the problem is in what you send. Look at the shutdown register first — display test overrides it, so a chip still in shutdown passes this test and fails everything else.
Power or wiring. Measure VCC against GND at the pads, not at the other end of the leads: it needs 4.0 V or more. Then check the pad order, because GND and VCC are adjacent and one position out puts 5 V into DIN. Then check the header is soldered.
A joint on the panel that has not wetted. Display test drives all eight digits at full brightness through the chip's own logic, so anything dark under it is a connection between the chip and the LED, not anything you can fix in code.
Nothing in a sketch changes overnight, so start with the physical. An unsoldered header, a lead that has worked loose in a screw terminal, and a supply shared with something new are the three that account for most of these.
Two chips with different scan limits, if this is two boards. On one board it cannot happen — one chip scans all eight digits at the same duty. If one panel really is dimmer than the other on a single board, the panels are different colours: blue LEDs need more forward voltage than red and look dimmer at the same current.
Almost always the segment bit order, and it only shows on asymmetric characters. 0, 1 and 8 survive being mirrored and look perfect, so check a 2, a 4 or a 7 before concluding the display is fine.
The specifications for the kit, what is in the box, the datasheet, and the questions people ask first.
Back to the reference →Edit this page — content/books/max7219-tube-clock/when-a-digit-goes-missing.mdx
Questions about this product
See what other owners have asked, and read their solutions.
MAX7219 Vintage Tube LED Clock Kit
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.