
This is a Pomodoro timer with VGA video output (640x480 @ 60 Hz) and an audible alarm. The project is based on the Tiny Tapeout VGA template ("Drop" demo).
Time base. The hvsync_generator module provides the x and y position of the current pixel. One pulse per frame (x == 0 && y == 0) gives a 60 Hz time base; counting 60 frames takes one second off the timer. The real VGA clock gives ~59.94 Hz, so there is an error of roughly 0.1 % (about 1.5 s over 25 minutes).
Counter. Time is stored in BCD (tens and units of minutes and seconds), so no dividers are needed. It can be adjusted from 00 to 99 minutes. There are three presets: 25 min (work), 5 min (short break) and 15 min (long break).
Display. There is no framebuffer: for each pixel (x, y) the logic decides whether it is on or off. The digits use a 5x7 font stored as constants and scaled x16, showing a centered MM:SS. Three small squares at the bottom indicate the selected preset (left = 25, center = 5, right = 15). Colors: yellow = paused, green = running (the colon blinks every second), white on a blinking red background = alarm.
Alarm. When the timer reaches 00:00 the alarm is triggered: a square wave on uio_out[7] that alternates between two tones (~437 Hz and ~656 Hz) in a beep-beep pattern. The wave is generated with a counter that updates once per horizontal line (frequency = 31469 / (2 × half-period)). The alarm stops with any button press or by itself after ~30 s, and the next preset is then loaded automatically (work → short break, any break → work).
Buttons. Each input goes through a 2-flip-flop synchronizer and is sampled once per frame (60 Hz) with edge detection, which also filters out mechanical bounce.
uio[7]. Use a 25.175 MHz clock.rst_n low, then high). The display should show 25:00 in yellow (paused).| Pin | Function |
|---|---|
ui[0] |
Start / pause (also silences the alarm) |
ui[1] |
Reset: reloads the current preset and stops |
ui[2] |
+1 minute (only while paused) |
ui[3] |
-1 minute (only while paused) |
ui[4] |
Cycle preset 25 → 5 → 15 → 25 (only while paused) |
ui[0] to start: the counter turns green and counts down every second. Press again to pause.For a quick test, set a short time with ui[3] (for example 01:00) or use the 5-minute preset.
uo_out and a VGA monitor.uio[7].ui[0]–ui[4], with pull-down resistors.| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | start | R1 | |
| 1 | stop | G1 | |
| 2 | increment | B1 | |
| 3 | decrement | VSync | |
| 4 | change_preset | R0 | |
| 5 | G0 | ||
| 6 | B0 | ||
| 7 | HSync |