Q: For an RTC using DS1390U-33 and using SPI in multiple-byte mode with 0.04 as the read period, at one random point, in units of 10ms, when jumping to 20ms a read error occurred, but returned to normal during the next period. How do I solve this?
A: When reading the hundredths of seconds register, if the read occurs at the same moment as the register was being updated, a read error is likely to occur. The solution is:
1. Use the SQW waveform to synchronize the data read. Read data on the rising edge or falling edge.
2. The simplest solution is to read twice consecutively, then determine if the read results are the same. If the read results are the same, that means the read was correct. Otherwise, a read error has occurred, and the read operation need to be repeated.