This application note presents how to use the ST7 Timer output compare function to generate a real time clock with counters for seconds, minutes and hours, based on a fixed basic time base.
This document presents an application example for generating a real-time clock based on seconds, minutes, and hours. It details how to use the ST7 Timer output compare function to create a fixed time base for interrupt generation.
The guide covers hardware configuration using the ST72324 microcontroller with an 8 MHz crystal and provides flowcharts for updating Output Compare registers and software counters (100ms, seconds, minutes, hours). It also includes source code availability in assembly and C.
The selected crystal has an 8 MHz frequency which results in fopu of 4 MHz.
The counters are output through I/O ports and displayed on LEDs, with the Seconds counter shown by a red LED and the Minutes counter by a pink LED.