2.4.4 Master Mode 7-Bit Receive Sequence
The following steps highlight a typical 7-bit receive sequence:
- Software sets the SEN bit, master hardware generates a Start condition.
- Upon the completion of the Start condition, hardware sets SSPxIF.
- Software clears the SSPxIF bit.
- 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’. - The address is shifted out on the SDA pin until all eight bits have been transmitted.
- Master hardware clocks in the ACK value from the slave and copies the value into the ACKSTAT bit.
- Master hardware sets the SSPxIF bit. If the SSPxIE bit is also set, an interrupt is generated. SSPxIF must be cleared by software.
- Software sets the RCEN bit, and the master clocks in a byte from the slave.
- 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.
- Software clears SSPxIF and reads the received byte from SSPxBUF, clearing the BF bit.
- Software clears the ACKDT bit and initiates an ACK sequence by setting the ACKEN bit.
- Master hardware transmits the ACK sequence.
- On the ninth falling clock edge, SSPxIF is set. Software must clear SSPxIF.
- Repeat steps 8 - 13 until all bytes have been received from the slave.
- 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.
