© Warren Gay 2018
Warren GayBeginning STM32https://doi.org/10.1007/978-1-4842-3624-6_10

10. Real-Time Clock (RTC)

Warren Gay1 
St. Catharines, Ontario, 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 Projects

The demonstration programs for this chapter come from the following two project ...

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.