This application note describes how to implement a periodic alarm using ST's TIMEKEEPER M48T59 and M48T59Y. The alarm can be set for a given time and day, or to repeat at a certain day in every month, or at a certain hour in every day, or at a certain minute of every hour, or at a certain second of every minute.
The document describes the implementation of periodic alarm functionality for the TIMEKEEPER M48T59 and M48T59Y real-time clock (RTC) devices. It details how to configure the hardware registers to set alarms that repeat at specific intervals, such as every second, minute, hour, or day.
The guide provides software configuration steps in C language for an embedded microcontroller unit (MCU). It covers setting the alarm parameters, managing interrupt flags to prevent system jams, and handling data conversion between Binary-Coded Decimal (BCD) format used by the device and integer formats used by the software.
The document is specifically tailored for the M48T59 (or M48T59Y) device, though ideas can be adapted to other TIMEKEEPER devices with the alarm feature.
The period is defined by setting specific Repeat bits (RPT4-RPT1) in the alarm registers and loading corresponding values into software variables for seconds, minutes, or hours.
The program has been written in ANSI C and was compiled and tested with an M68HC11 series MCU.