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:
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!
Hi Vikas,
thank you for confirmation. Given the PCA2131 behavior described in the datasheet, and assuming AE_S/AE_M/AE_H/AE_D/AE_W are all 1. it does not look the RTC is legitimately re-triggering AF. Most likely cause is bitfield ordering mismatch. Could you please catch and share the scopes of the three reading, writing SPI messages? To confirm the timing and registers/bits written and read.
With Best Regards,
Jozef
Hi Vikas,
please double check the Alarm registers. These registers have address 0Eh to 12h.
Please try to set all the AE_x bits to 1 again.
With Best Regards,
Jozef