Setting and reading the time
During read/write operations, the time counting circuits (memory locations 02h through 08h) are blocked.
This prevents
Faulty reading of the clock and calendar during a carry condition
Incrementing the time registers, during the read cycle
After this read/write access is completed, the time circuit is released again and any pending request to increment the time counters that occurred during the read access is serviced. A maximum of 1 request can be stored; therefore, all accesses must be completed within 1 second.
As a consequence of this method, it is very important to make a read or write access in one go, that is, setting or reading seconds through to years should be made in one single access. Failing to comply with this method could result in the time becoming corrupted.
As an example, if the time (seconds through to hours) is set in one access and then in a second access the date is set, it is possible that the time may increment between the two accesses.
A similar problem exists when reading. A roll over may occur between reads thus giving the minutes from one moment and the hours from the next.
Recommended method for reading the time:
Send a START condition and the slave address for write (A2h).
Set the address pointer to 2 (VL_seconds) by sending 02h.
Send a RESTART condition or STOP followed by START.
Setting and reading the time During read/write operations, the time counting circuits (memory locations 02h through 08h) are blocked. This prevents
After this read/write access is completed, the time circuit is released again and any pending request to increment the time counters that occurred during the read access is serviced. A maximum of 1 request can be stored; therefore, all accesses must be completed within 1 second. As a consequence of this method, it is very important to make a read or write access in one go, that is, setting or reading seconds through to years should be made in one single access. Failing to comply with this method could result in the time becoming corrupted. As an example, if the time (seconds through to hours) is set in one access and then in a second access the date is set, it is possible that the time may increment between the two accesses. A similar problem exists when reading. A roll over may occur between reads thus giving the minutes from one moment and the hours from the next. Recommended method for reading the time: