What are the steps to read the sequence of bytes from the I2C device? like if I need to read two registers seconds and minutes What will happen?
Here is my understanding
Master send repeat start on the I2C bus
Master send slave address 0xD1 reading mode
Master generates ACK/NAK
Master sends the address of seconds 0x00
Master generates ACK
Master sends the address of minutes 0x01
Master generates NAK after the last byte
You need tell the DS1307 where you want to read from, also read again my post above on who generates the ack.
To read seconds and minutes:
1. Send a start sequence
2. Send 0xD0, slave generates ack. (Yes, its a write command!)
3. Send 0x00, the address of the seconds reg, slave generates ack.
4. Send start sequence again, (restart)
5. Send 0xD1, slave generates ack. (Now its a read command)
6. Read seconds reg, master generates ack.
7. Read minutes reg, master generates ack.
8. Send stop sequence.