STMicroelectronics AN974 Real Time Clock Application Note

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.


STMicroelectronics AN974 Real Time Clock Application Note - cover page
Brand
STMicroelectronics
Category
microcontrollers
Document type
Application Note
Language
English
Pages
6
File format
PDF
File size
67 KB
Published
07 August, 2012
Updated
30 September, 2023
Model
ST7
MD5 checksum
3562B1BA92A93A3CD7D1E4469DDCB9E8

About this manual

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.

What's inside

  • Introduction
  • Generating a Time Base
  • Timer Configuration
  • Output Compare Update
  • Real Time Clock Application
  • Hardware Configuration
  • Software Implementation

Frequently asked questions

What frequency is used for the crystal in this example?

The selected crystal has an 8 MHz frequency which results in fopu of 4 MHz.

How are the seconds and minutes displayed to the user?

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.

Download PDF (67 KB)

More STMicroelectronics Manuals


View all STMicroelectronics manuals →