The main part is a state machine that incrementally rasterizes three triangles based on their edge equations while generating the timing for VGA. Every frame the second, minute, and hour are updated which are indexed into tables to get the edge equations corresponding to the moving hands.
Hook up the TinyVGA to the output (not bidir) port and that to a VGA monitor. Marvel at the display. Assert input pin 6 and 7 to move the minute and hour hand respectively.
TinyVGA is required, otherwise this is a pretty boring design.
# | Input | Output | Bidirectional |
---|---|---|---|
0 | debugsel0 | R1 | |
1 | debugsel1 | G1 | |
2 | debugsel2 | B1 | |
3 | debugsel3 | vsync | |
4 | unused0 | R0 | |
5 | unused1 | G0 | |
6 | minute, advance minute | B0 | |
7 | hour, advance hour | hsync |