First completed: May 2013
Introduction
This project was my first attempt at driving a dot-matrix LED display from a microcontroller without using any dedicated driver chips. It was also, at the time, my most advanced PCB design. Prior to this project, the most complex LED multiplexing I had done directly from a microcontroller was a 6-digit 7-segment display, which in terms of complexity is equivalent to a single 8x6 LED dot matrix.
I decided to use an ATmega328p pre-programmed with the Arduino bootloader for this project.
Hardware
The main elements of the design are the microcontroller with its supporting components, the displays with their shift registers (these are hidden behind the displays on the PCB), and a switching regulator.
The schematic below shows the design excluding the switching regulator.
The shift registers are a serial-in-parallel-out type, and were needed because the ATmega328p does not have enough pins to drive the display directly. The shift registers are 74HC164, as with the Noughts and Crosses game.
The PCB layout was done by me, but the board itself was made by a third party. The PCB was made on a PCB router and the board is not through-hole plated - I learned a very important lesson here as to why through-hole plating is usually important. The design relied on through-hole connections being connected to both sides, so it was necessary to solder some of the pins on both sides to simulate through-hole plating.
Software
The LED displays are multiplexed. Only one row of the display is lit at a time; each row is switched on in turn very rapidly, and this technique relies on persistence of vision to make it look like the entire display is continuously lit.
The animation below shows the technique in action but for column scanning.
Initially, the software was a simple design which just used delays in the main loop of the code to switch between the rows. This method works reasonably well on the ATmega328p at 16MHz because it can execute instructions fast enough to avoid functions in the main code from having a visible effect on the display, but it makes writing the code more difficult because delays and "slow" commands cannot be used. The software design was later enhanced by using a timer interrupt to run the display software, making its timing independent of what happens in the main code.
The display shows the time, and a scrolling effect is used whenever a digit changes. The time is synchronised using a "Time from NPL" receiver, the signal from which is decoded by the software. The use of the timer interrupt for driving the display, the author's extra experience with using the ATmega328p, and the removal of the external RTC allowed the time decoding to be done without the extra microcontroller that was used in the 6-inch jumbo radio-controlled LED clock/timer project.