This demo (rtcDemo directory) shows how to use the on-board PCF8523 RTC module on the Ti375C529 FPGA. The demo allows the user to change various configurations such as real-time data with a convertible 12/24hr time system, alarm, and battery settings of the PCF8523 module when the main menu feature is enabled, otherwise it will print the real-time data every few seconds.
For more details on the driver API, refer to Real Time Clock (RTC) Driver.
By default, newlib-nano is used for this demo.
In userDef.h, the available RTC drivers are defined as follows:
To switch the RTC driver, modify ACTIVE_RTC_TYPE to the desired type.
Each selection automatically maps to the corresponding RTC_CTRL(I2C address) and RTC_DRIVER(Driver implementation).
| ACTIVE_RTC_TYPE | Driver | Description |
|---|---|---|
| RTC_TYPE_PCF8523 | PCF8523 | Default on-board RTC (Ti375C529) |
| RTC_TYPE_DS3231 | DS3231 | External high-accuracy RTC module |
| RTC_TYPE_CUSTOM | User-defined | Bring user's own RTC driver |
To integrate a custom RTC driver into the framework, follow these steps:
Step 1 — Align custom driver to the RTC framework
Ensure custom driver implements the rtc_api_t interface for seamless integration.
Step 2 — Register custom driver in userDef.h
Uncomment and update the custom driver section:
Step 3 — Select the custom driver
The following shows the expected execution sequence: