A fantastic discussion on the subject is listed in
The Printed Circuit
The printed circuit board (PCB) is a standard two-layer
version, and has no complicated manufacturing issues for
most board houses. As mentioned, the Eagle files as well as
Gerber (RS274x) files for those board houses that do not
accept native Eagle files are at the article link. Of interest is
These chips come in wide and narrow packages, and
in the past I have received either or both mixed in my
orders. Functionally either one is acceptable, so I created
an Eagle footprint that would accept both wide and
narrow formats. This is shown in greater detail in the
download package for this article.
The circle of LEDs was created by specifying a set of
vector coordinates in Eagle by specifying the center,
radius, and angle for each LED. The board is about 6”
square, and has four mounting holes in which stand-offs
are used to hold the front and rear Plexiglas or acrylic
panels which allows the finished product to stand vertical.
A free version of Eagle CAD can be downloaded from
the link in Resources.
The software is written in MPASM (absolute code) —
an assembly language for the PIC. The development IDE
(integrated development environment) includes the
programming software for the PICkit3 mentioned earlier,
and can be downloaded for free from the Microchip
website (see Resources).
The source code is available at the article link. The
code is heavily commented, so it will help those who wish
to dig further into that aspect of the project. Aside from
the rather simple section of code that runs the clock, there
is a LOT of stuff involved in running the LED displays. This
PIC has two eight-bit internal timers and one 16-bit timer,
which each generate an interrupt when overflowing. One
is used for the time, overflowing every second to advance
the clock; the second is used to schedule the display
updates; and the third is used for the LEDs.
In the various LED patterns, a “dot” flies around the
circle, filling each circle one second at a time. At the 60
second mark, all dots are lit and reset at the new minute.
The dot at the start of the minute must make 60 steps to
reach the end, and each subsequent dot makes one step
less than the previous one. That means the timing of each
step changes with each subsequent second.
Timer 2 has a special register (PR2) that allows the
timer period to be changed on-the-fly; the timing values
required for each step are stored in lookup tables. The
positions of the dot are also stored in a lookup table.
Setting preferences (12/24 mode and preferred LED
32 September 2016
■ FIGURE 14. Example of a PCB that can
accommodate both wide and narrow versions of
the SMD chip.
■ FIGURE 13.
the clock set