-
Digital clock project
I'm in the process of building a large digital clock using VFD matrix tubes found on ebay. Here is an example of 5 tubes making up one digit:
http://www.youtube.com/watch?v=ACQd9gfyBRE
This will be a 4 digit 24 hour style clock and each digit is controlled by an Allegro A6812 20 bit serial latch. All the latches are driven from the same serial line with separate strobe lines. To keep time I plan on using http://www.picbasic.co.uk/forum/showthread.php?t=2129 which looks simple and accurate enough for a home clock.
It takes 20 bits to light up each digit, for example 0 = $0D, $C1, $B7 and 1 = $04, $80, $92. What I'm not sure about is how to use a lookup table to get this information. Use a table with 0 to 9 and then always read the index plus two in order to write the required bits? Any thoughts?
-
I would use 3 lookup commands
Code:
lookup digit, [$0D,$04, ...], patternA
lookup digit, [$C1,$80, ...], patternB
lookup digit, [$B7,$92, ...], patternC
Lookup2 allows for 16 bits, but that still would not meet your needs for 20 bits.
-
An ugly way that would probably work are two long select case commands for HH and MM. If HH = 1 then... if HH = 2 then... etc etc. Maybe have one go from 00 to 59 and the other in reverse order to save instruction time.