Hi everyone,
I am currently integrating the PCA2131 Automotive RTC into a Battery Management System (BMS).
I am encountering a persistent issue where the Alarm Flag (AF, bit 4 of Control_2 register 01h) is stuck high. Basic SPI communication is functioning perfectly-I can successfully set and read the time registers without issue. However, I cannot clear the AF flag during initialization.
Important Context:
- I have already ensured that all Alarm Enable (AE_X) bits in the alarm registers (0Ah through 0Eh) are set to 1 (disabled) prior to attempting to clear the AF flag.
The sequence I am executing:
Read Control_2 (Register 01h). The AF bit reads as 1.
Clear the flag by setting AF = 0 and AIE = 0 in my local struct.
Write the modified byte back to Control_2.
Read Control_2 again. The AF bit is still 1.
I have attached screenshots from my debug session showing the register states before clearing, during the clear operation, and after reading it back.
My Questions:
Given that all AE_X bits are disabled, what other internal conditions could force the AF flag to immediately re-assert (or prevent it from clearing)?
Any insights or recommendations would be greatly appreciated!