In this publication, an example project using the PCF8523 is shown to demonstrate the easy use of the RTC devices from NXP.
The PCF8523 is a real-time clock based on an ultra -low power oscillator and using an I2C- bus for interfacing. Some of its features are shown below:
In this example, the PCF8523 is configured using the I2C interface based on the document UM10760 to generate an interrupt every second. Once the interrupt is generated, the time is read and stored into different variables.
The project was created using the FRDM-KL25Z platform and the OM13511 (I²C-bus RTC PCF8523 demo board). The complete source code is written in KDS IDE. You may find the complete project attached to this post.
I highly recommend using the OM13511 as a reference for your projects.