ATtiny2313, which comes in at 2kB of flash program space, and 128 bytes of RAM. This is plenty for this application, since it only needs to download three bytes worth of time from the real time clock chip, and then display them on the seven segment displays.
Note that flicker on the display in the video is an artifact of the video, and isn't visible in person.
From a software side, the first challenge was multiplexing the four digits of the display. This was the first time I have done anything with interrupts, but once I got an LED to blink, extending it to switch digits on and off 300 times a second was fairly trivial.
Next was talking to an RTC. I originally tried using a DS1306 SPI RTC, since SPI is a significantly simpler protocol to implement in software. For some reason beyond me, I couldn't get my DS1306 to talk to me, so I downloaded Atmel application note AVR310, "Using the USI module as a I2C master." This comes with a complete I2C library, which meant I could use my trusty DS1307 once again, but left me unsatisfied with reusing someone else's code. This meant I spent most of my time on this project simply reimplementing their library how I wanted it. My version does seem to compile to a few dozen bytes larger than theirs, but I feel like the code is much easier to read. The entire program comes in under 1300 bytes anyways, so it all fits on the ATtiny2313 in the end.
- 1 ATtiny2313 ($2.47 Digikey)
- 1 momentary push button($0.23 Digikey)
- 1 74LS47 BCD to seven segment decoder (Good luck finding somewhere to buy that)
- 1 DS1307 RTC ($3.74 Digikey)
- 1 32.768kHz quartz crystal ($0.32 Digikey)
- 1 4 DIP switch
- 4 2N3906 PNP transistors ($0.36 Digikey)
- 4 1k resistors
- 8 100Ω resistors
- 2 4.7k resistors for the I2C lines
- 1 3.5 digit 7 segment display (Bought mine locally at Halted)
- Optional serial port and 3 4.7k resistors for in circuit programming