The following things are not yet done for the Word Clock:
- Real time clock
- Human interface
However, I have been able to write the display routines, and a basic loop around the the display. The idea is that the display routine display_time(char hh,char mm) takes two variables, the hour (in hh) and minutes (in mm), and figures out which LEDs to light, and sets an array of globals. A second routine show_time() pushes the globals out to the shift registers in the right order. show_time() has to be called often, as we are multiplexing the LEDs, but display_time() only needs to be called when the time changes.
As the RTC isn’t yet implemented, looping through the times can then be set to run fast, so that you don’t have to wait 24 hours to test the display logic.
The video is here: http://youtu.be/iacYOHE3SZk
No audio, because we were watching BSG whilst testing, so I stripped that out.
I’ve wired in a DS1305 RTC chip, which has multiple functions. It can operate as a stable 1 second pulse (I’ve wired to a pin on the PIC that allows interrupt on change), it can raise alarms, and it can also, over a serial link, give you a binary string representing the time (including a date if required!). I haven’t decided whether just to use it as a reliable 1 second pulse, and do all the time counting in the PIC code, or to off load all time counting to the DS1305, and just ask it every minute (or so) what the time is, and feed that to the display_time(hh,mm) routine. Current program storage use is only 60% at the moment, so should have room for either. I’ll probably try having the DS do the time keeping and see if it all fits in the code space.