SPRUHZ7K August 2015 – April 2024 AM5706 , AM5708 , AM5716 , AM5718 , AM5718-HIREL
Table 23-9 lists the steps for initializing the RTC module when the module is to be used for the first time.
Step | Register/Bit Field/Programming Model | Value |
---|---|---|
Write 0x83E7 0B13 to the Kick0 Register to unlock register writes | RTC_KICK0_REG | 0x83E70B13 |
Write 0x95A4 F1E0 to the Kick1 Register to unlock register writes | RTC_KICK1_REG | 0x95A4F1E0 |
Select the clock source (internal or external 32-kHz clock) | RTC_OSC_REG[3] 32KCLK_SEL | - |
If external clock is selected, start the oscillator. Wait for oscillator to stabilize. | RTC_OSC_REG[4] OSC32K_GZ | 0 |
Enable the 32-kHz clock | RTC_OSC_REG[6] 32KCLK_EN | 1 |
Configure slave idle mode | RTC_SYSCONFIG_REG [1:0] IDLEMODE | 0x- |
Enable interrupts, if needed | RTC_INTERRUPTS_REG[4:0] | 0x- |
Enable wakeup interrupts, if needed | RTC_IRQWAKEEN[1:0] | 0x- |
Set current time | RTC_SECONDS_REG[6:0] | BCD |
RTC_MINUTES_REG[6:0] | BCD | |
RTC_HOURS_REG[5:0] | BCD | |
Set current date | RTC_DAYS_REG[5:0] | BCD |
RTC_MONTHS_REG[4:0] | BCD | |
RTC_YEARS_REG[7:0] | BCD | |
RTC_WEEKS_REG[2:0] | BCD | |
Run the real-time clock | RTC_CTRL_REG[0] STOP_RTC | 1 |