Digital Countdown Timer — 8051
AT89S52 · Multiplexed 7-Segment · Touch Sensor · Keil µVision
Countdown timer on the AT89S52 (8051) with a multiplexed 4-digit 7-segment display, TTP223 capacitive touch sensor for start/stop, push-button time adjustment, and buzzer alarm. Achieves <1% timing deviation on a 12MHz crystal — all firmware in bare-metal C.
Video Demonstration
Project Objective
Implement a reliable countdown timer on bare 8051 hardware — no HAL, no RTOS — demonstrating direct register manipulation, timer interrupt configuration, and multiplexed display driving.
Hardware Design
The 4-digit display is driven via multiplexing at 400Hz refresh — each digit enabled for ~2.5ms in rotation, invisible to the human eye. TTP223 handles start/stop; push buttons adjust minutes and seconds.
- →4-digit 7-segment multiplexing at 400Hz refresh
- →TTP223 capacitive touch — debounce-free input
- →Push buttons with 50ms software debounce filter
- →12MHz crystal for accurate interrupt timebase
Firmware Architecture
Written in C with Keil µVision. Timer 0 in Mode 1 (16-bit) generates 10ms interrupts as the timebase. The ISR decrements the countdown counter, refreshes the display multiplexer, and monitors debounced button state.
- →Timer 0 Mode 1 — 10ms interrupt timebase
- →ISR handles display refresh + countdown decrement
- →Software debounce for push buttons (50ms filter)
- →Buzzer driven via GPIO on countdown completion
Results
Achieved <1% timing deviation across a 10-minute countdown. No visible display flicker. Touch input more reliable than mechanical buttons in repeated testing. Total BOM cost under Rs.200.
