Tables.” The upper nibble contains the line number that is
to be driven high and the lower nibble contains the line
that is to be driven low. Each nibble is in the range of
1.. 14 decimal. The nibbles are then looked up using the
tables under the heading “Charlieplex Port Masks” to
calculate and set the Port and Tris values.
To set the Port and Tris values, the main routine calls
timeLEDout or alrmLEDout (in led.inc) as appropriate. For
each LED to be lit, these routines perform the lookups
outlined above and calculate the Port and Tris values for
both Port A and Port B. The Port and Tris values are not
sent to the actual Port and Tris registers but are stored in
shadow registers. The interrupt routine copies the shadow
registers to the actual Port and Tris registers at the
appropriate time for each LED.
Two additional files — definitions.inc and registers.inc —
contain definitions for constants, file registers, bit
assignments, time calculations, and port definitions. I’ve
34 May/June 2018
Parts source for most of the
Additional parts source.
Manufacturer of the microcontroller
used for the clock. Of particular
interest is their Charlieplexing
application note TP029
6) and their free MPLAB IDE
Schematic and printed circuit board
design software. Free version
support up to 300 pins and two
signal layers for non-profit use, or
500 pins and two signal layers for
Bay Area Circuits
Manufactures printed circuit boards.
They had a student special that
allowed me to make the board for
my clock for only $30 at the time.
Real-time monitoring of electric grid
frequency from around the world.
Wikipedia — "Utility Frequency"
This article has a lot of information
about the 50 or 60 Hz frequency
used by the utility companies. Of
particular interest is the section on