© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2024
W. GayBeginning STM32Maker Innovations Serieshttps://doi.org/10.1007/979-8-8688-0199-0_10

10. Real-Time Clock (RTC)

Warren Gay1  
(1)
St. Catharines, ON, Canada
 

Tracking time is often important in applications. For this reason, the STM32 platform provides a built-in real-time clock (RTC) peripheral. The datasheets for the RTC appear almost trivial to use, but there are wrinkles waiting for the unwary.

This chapter will examine how to set up interrupt service routines (ISR) for a recurring one-second interrupt event as well as the optional alarm feature. Armed with this information, there is no reason for your MCU applications to lack time information.

Demonstration ...

Get Beginning STM32: Developing with FreeRTOS, libopencm3, and GCC now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.