2.4.4 Master Mode 7-Bit Receive Sequence

The following steps highlight a typical 7-bit receive sequence:

  1. Software sets the SEN bit, master hardware generates a Start condition.
  2. Upon the completion of the Start condition, hardware sets SSPxIF.
  3. Software clears the SSPxIF bit.
  4. Software loads SSPxBUF with the 7-bit slave address and R/W bit. In 7-bit Master Receive mode, the R/W value is ‘1’.
  5. The address is shifted out on the SDA pin until all eight bits have been transmitted.
  6. Master hardware clocks in the ACK value from the slave and copies the value into the ACKSTAT bit.
  7. Master hardware sets the SSPxIF bit. If the SSPxIE bit is also set, an interrupt is generated. SSPxIF must be cleared by software.
  8. Software sets the RCEN bit, and the master clocks in a byte from the slave.
  9. After the eight falling clock edge, the byte is transferred from the SSPxSR and sets the SSPxIF and BF bits. RCEN is cleared by hardware.
  10. Software clears SSPxIF and reads the received byte from SSPxBUF, clearing the BF bit.
  11. Software clears the ACKDT bit and initiates an ACK sequence by setting the ACKEN bit.
  12. Master hardware transmits the ACK sequence.
  13. On the ninth falling clock edge, SSPxIF is set. Software must clear SSPxIF.
  14. Repeat steps 8 - 13 until all bytes have been received from the slave.
  15. Master software can end communication by performing one of the following:
    • Software sets the ACKDT bit and transmits a NACK sequence by setting the ACKEN bit.
    • Software sets the PEN bit and hardware transmits a Stop condition.
    • Software sets the RSEN bit and hardware issues a Restart condition.
Figure 2-11. I2C Master Mode Waveform (Reception, 7-bit Address)