I like the look on the QWiiC RTC, and have been able to write to it (as evidenced by the ability to change the Clkout frequency by setting the FD bits in register 0Dh.
However, I’ve been unable to read back the contents of that (or any other) register, what I get is a value equal to the Registers address. I assume I’m doing something wrong, can anyone advise please ?
Problem Detail…
To Read from the RV-8803 the following steps are required.
-
Master sends out the START condition.
-
Master sends out Slave Address, 64h for the RV-8803-C7; the R/W bit is a 0 indicating a write operation.
-
Acknowledgement from RV-8803-C7.
-
Master sends out the Register Address to RV-8803-C7. (eg 0Dh)
-
Acknowledgement from RV-8803-C7.
-
Master sends out the Repeated START condition (or STOP condition followed by START condition)
-
Master sends out Slave Address, 65h for the RV-8803-C7; the R/W bit is a 1 indicating a read operation.
-
Acknowledgement from RV-8803-C7.
At this point, the Master becomes a Receiver and the Slave becomes the Transmitter.
-
The Slave sends out the Data from the Register Address specified in step 4). (What I appear to receive is 0Dh and not the value I know to be contained in that register)
-
Acknowledgement from Master.
-
The Master, addressed as Receiver, can stop data transmission by not generating an acknowledge on the
last byte that has been sent from the Slave-Transmitter. In this event, the Slave-Transmitter must leave the
data line HIGH to enable the Master to generate a STOP condition.
- Master sends out the STOP condition.