2.4.5 Master Mode 10-Bit Receive Sequence
The following steps highlight a typical 10-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
10-bit high address byte and R/W bit. In 10-bit Master
Receive mode, the first time the high address byte is transmitted, the
R/W bit value is ‘
0’ (see Figure 2-12). - The high address byte is shifted out on the SDA line 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 loads SSPxBUF with the 10-bit low address byte.
- The low address byte is shifted out on the SDA line 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 RSEN bit, hardware issues a Restart condition.
- Software loads SSPxBUF with the
10-bit high address byte and R/W bit. This second stage of
addressing in 10-bit Master Receive mode requires the R/W
bit value to be ‘
1’. - The high address byte is shifted out on the SDA line 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 hardware 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 17 - 22 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.
