The direction of data flow on SDA can be
changed by the controller, without first stopping a transfer, by issuing a repeated START
condition. This is called a RESTART, see data format in Figure 24-8. After a
RESTART is issued, the target address is again sent out with the new data direction
specified by the R/W bit.
A repeated start sequence for a controller
transmit or receive is as follows:
- When the device is in the idle state, the
Controller writes the target address to the TA register and configures the DIR bit for the
desired transfer type.
- Data is written to the TXDATA register
(for transmit) or RXDATA register (for receive).
- When SR.BUSY status reads back as ‘0’,
FRM_START and START bits in the CTR register are set to initiate a transfer.
- Software waits till BUSY bit in the SR
register reads back as ‘0’.
- The controller can now change direction
of transfer or address another target, by generating a restart condition. Software updates
TA register and then, sets FRM_START. This initiates a repeated start on the line.
Note: if there is a NACK for
address, a STOP condition will be automatically generated. RESTART cannot be sent in
that case.