Simple digital clock, displays hours, minutes, and seconds in either a 24h format.
Since there are not enough output pins to directly drive a 6x
7-segment displays, the data is shifted out over SPI to a MAX7219 in 7-segment mode.
The time can be set using the hours_set
and minutes_set
inputs.
If set_fast
is high, then the the hours or minutes will be incremented at a rate of 5Hz,
otherwise it will be set at a rate of 2Hz. Note that when setting either the minutes, rolling-over
will not affect the hours setting. If both hours_set
and minutes_set
are presssed at the same time
the seconds will be cleared to zero.
A block diagram of the system is shown below.
Apply a 5MHz clock to the clock pin and 32.786Khz signal to the refclk pin.
Use the hours_set
and minutes_set
pins to set the time.
Connect the BIDIR PMOD to a MAX7219 7-segment display, For reference Tiny Tapeout SPI
# | Input | Output | Bidirectional |
---|---|---|---|
0 | refclk | Display CS | |
1 | Display MOSI | ||
2 | Fast/Slow Set | ||
3 | Set Hours | Display SCK | |
4 | Set Minutes | ||
5 | 12-Hour Mode | ||
6 | |||
7 |