and 60 Hz. So far, so good.
However, RA5 —the input-only pin — had no analog
capability; it could not be connected to the chip’s internal
comparator. Not only was RA5 just an input line, it was a
digital-only input line. Therefore, my first idea of using a
resistor network to feed varying voltages to the input pin
would not work. However, a second idea of strobing the
buttons with four of the LED lines just might.
The Test Circuit
The finished test circuit can be seen in Figure 3. I
used a wall wart with a nine volt AC output to power the
circuit. It connects to J1 and J2 of
the schematic shown in Figure 4. I
built a bridge rectifier (D5-D8),
followed by a +5V regulator (U1),
and then the appropriate filter
capacitors (C1-C2) to create the
power supply. The 12-LED
Charlieplex matrix (DH00-DH03,
DM00-DM03, DS00-DS03) was
then wired up to four of the I/O
pins through the appropriate
current-limiting resistors (R1-R4).
The nodes that are after the
current-limiting resistors are CP01-
The test code had the
microcontroller running a sequence
on these 12 LEDs — similar to what would be used for the
finished clock, with each LED lit 20% of the time. I
discovered a couple of things.
First, Charlieplexing LEDs works remarkably well. I
expected to see a tiny amount of light coming from the
LEDs that were off since there would be a tiny amount of
current flowing through them anyway. Even in a pitch-dark
room with the lit LEDs completely covered, I could not
detect any light coming from the unlit LEDs.
Second, I was surprised to find that for the proper
balance in apparent brightness of the LEDs, the T1-3/4 ( 5
mm) LEDs had to be rated more than two times as
luminous as the T1 ( 3 mm) LEDs. It made sense when I
■ FIGURE 3. Test circuit on breadboard.
■ FIGURE 4. Test circuit
schematic with power
26 March 2018