It Ain’t Easy Bein’ Green
I LOVE VINTAGE DISPLAY TECHNOLOGIES. You get a lot of that out of me on this blog— I do realize. Alas, here is another.
For this build, the first four “tubes” I made for this clock were solid white PLA and they helped model how much clock I could fit behind four IV-6s before I committed myself to soldering forty-odd fragile little wires to a board. Forty odd little wired attached to 4 odd little tubes. Read on….

When I built The Digital Clock, you could follow a minute as it worked its way through a row of 4017 decade counters. This time National Semiconductor did the counting for me. Their MM5316N fits the counters, the alarm logic and the display drivers into one 40-pin chip. What it expects me to supply is a national grid’s sense of AC time. More on that in a minute.
Making room for four tubes
I laser-cut the round front window from clear acrylic and wanted the four digits to fill it from side to side. That settled the width of the display pretty quickly, but it told me very little about how deep the case had to be. I printed four dummy tubes and laser-cut wooden stand-ins for the boards and converters. I marked the blocks with their voltages so I could tell at a glance which converter I was trying to squeeze in.

In Fusion 360 I gave the cell a recess in the bottom of the round case and left an opening for the charging board’s USB-C connector. That last detail is easy to underestimate. The board can fit perfectly inside the case and still leave you nowhere to plug in a cable.

Four PCBs in a round case
I sent four sets of Gerbers to PCBWay. The power board and the clock mainboard share the same 56 mm-wide outline. I lined up the power pads so straight wires could pass from board to board in the sandwich. The tube breakout plugs into the mainboard at 90 degrees on a two-row pin-and-socket connector. That put the tubes upright behind the acrylic window, and I could still unplug all four as one piece.


How an IV-6 digit lights up
Each IV-6 is a vacuum fluorescent display with a single digit sealed inside the tube. A fine heated filament supplies electrons. With the grid positive, those electrons can reach whichever phosphor-coated segments the clock chip has driven positive.

The MM5316 drives this display statically. Each digit has its own segment connections, so there’s no software rushing around lighting one tube after the next. There’s even a 1 Hz output on pin 39. I wired that to the decimal point on the second tube to put a blinking separator between the hours and minutes.
What was this chip doing in 1973?
National Semiconductor was already advertising the MM5316 in September 1973. Two pins on the chip give away what its designers had in mind for a bedside clock. Snooze bought you another nine minutes in bed. Sleep let you listen to the radio for up to 59 minutes, at which point the chip could tell the radio to switch itself off. All that lived on the same piece of silicon that counted the seconds and worked out which segments made a 7. National’s 1973 announcement · National’s MOS/LSI databook
There’s a nice (German language) example in a 1974 issue of Funk-Technik. SABA’s electronic clock radio used the very same MM5316N. Follow its transformer secondary on the schematic and you can see it doing two jobs. One path was rectified to supply the clock chip with 25 V. The other fed a transistor that turned the 50 Hz from the winding into pulses the chip could count. Fifty years later I arrived at the same two requirements with a lithium cell on the bench. Supplying the voltage took a boost converter. Supplying the ticks takes a little more explaining. The 1974 SABA circuit, pp. 393–394
Three voltages from one cell
The 5 V USB-C port on the back charges a 500 mAh lithium-ion cell. I get about two hours with the clock unplugged. On my desk I leave the same cable connected and the clock runs continuously. Inside, two MT3608 boost converters take the cell voltage up to 25 V for the MM5316 and display drive, and 5 V for the Seeed Studio XIAO. A third converter, a buck on the tube board, takes that 5 V back down for the filaments.

I called the filament supply “1.2 V” in the design. On the bench I trimmed it to 1.042 V with the tubes running. I’d like these tubes to last. The IV-6 sheet lists 1.0 V as the nominal filament voltage and allows 1.2 V with a shorter guaranteed operating life. That made the reading below a much happier place to leave the adjustment. IV-6 tube data

Giving a battery clock its own 60 Hz
A mains-powered clock can count cycles from the AC line. The MM5316 accepts 50 or 60 Hz and divides the chosen frequency down to one tick per second. I left its frequency-select pin open for 60 Hz. The little problem here is that a battery supplies DC, and so does USB. Where do the sixty cycles come from?
That’s the Seeed Studio XIAO SAMD21’s entire job. The single working line in my sketch is tone(A0, 60);. The XIAO generates a square wave on A0, also marked D0, and a 2N2222 transistor shifts it up to the level the MM5316 expects on pin 35. From there the vintage chip takes over.

Here’s the catch. My clock gains about one minute every three days, or twenty seconds a day. If that gain comes entirely from the XIAO, its reference would average 60.014 Hz, about 231 parts per million fast.
My first suspicion was the timer having to round off a fraction. The arithmetic surprised me. In Seeed’s published SAMD core, the timer starts from a nominal 48 MHz, divides by eight, and toggles the pin every 50,000 counts. Two toggles make one cycle. That division comes out to 60 Hz exactly. The board still has to make its 48 MHz, though. In Seeed’s v1.8.5 startup code, a 32,768 Hz crystal sets the reference and the multiplier rounds to 1,465. With an ideal crystal that would make this clock run about nine seconds fast per day. Mine gains roughly twenty seconds a day. If I flashed this version of the core, the rounded multiplier could account for nearly half that gain. I haven’t verified which core version I flashed, so that calculation gives me a prediction to test on the bench. Seeed’s tone routine · SAMD21 clock setup
I’d start by counting rising edges at A0 for one hour against an independent time reference. Exactly 60 Hz gives 216,000 cycles. Seeed’s multiplier predicts about 216,023. A reading near 216,050 would account for the full minute I gain in three days. I’d repeat that count at MM5316 pin 35, on the other side of the 2N2222, and compare it with the chip’s 1 Hz output on pin 39. If A0 is on target but the chip counts fast, I’d look for ringing at pin 35 that might register as an extra pulse. One extra count every 72 seconds would explain the whole gain.
The alarm that you can set
If you spotted the surface-mount 555 footprint on the mainboard, that was my plan for the alarm. Pin 25 on the MM5316 provides an alarm drive signal. I intended to use it to enable a 555 tone generator, but I ran out of room for a speaker loud enough to be worth fitting. You can probably see why in the exploded view.

I kept Alarm Display and Alarm Off on the button board along with Fast Set, Slow Set and Seconds Display. Holding Alarm Display while pressing either set button advances the stored alarm time. The clock can remember precisely when I wanted it to make a noise. Someday I might even let it.


If you want to follow a second through the chip, start with Figure 1 in the National Semiconductor MM5316 datasheet (PDF). The divider, the counters and the segment drivers are all there on one page.
Two VFDs on my desk
Here’s the clock with some company. The four IV-6s on the left are reading 1:02. The tall VFD on the right is my server status display. It has room for CPU activity, RAM, temperature and uptime, with enough pixels left over for a happy Vault Boy to walk along underneath indicating a healthy server.



Leave a Reply