26.6.7.4 Typical Receive Sequence:
- The user generates a Start condition by setting the SEN bit.
- SSPxIF is set by hardware on completion of the Start.
- SSPxIF is cleared by software.
- User writes SSPxBUF with the slave address to transmit and the R/W bit set.
- Address is shifted out the SDA pin until all eight bits are transmitted. Transmission begins as soon as SSPxBUF is written to.
- The MSSP module shifts in the ACK bit from the slave device and writes its value into the ACKSTAT bit.
- The MSSP module generates an interrupt at the end of the ninth clock cycle by setting the SSPxIF bit.
- User sets the RCEN bit and the master clocks in a byte from the slave.
- After the eighth falling edge of SCL, SSPxIF and BF are set.
- Master clears SSPxIF and reads the received byte from SSPUF which clears BF.
- Master sets the ACK value to be sent to slave in the ACKDT bit and initiates the ACK by setting the ACKEN bit.
- Master’s ACK is clocked out to the slave and SSPxIF is set.
- User clears SSPxIF.
- Steps 8-13 are repeated for each received byte from the slave.
- Master sends a not ACK or Stop to end communication.