2.3.4 Master Mode 7-Bit Transmit Sequence
The following steps highlight a typical 7-bit transmit 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 Master Transmit mode, the
R/W value is ‘
0’. - 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 loads SSPxBUF with a data byte.
- Data is shifted out 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.
- On the ninth falling clock edge, SSPxIF is set by hardware. If SSPxIE is also set, an interrupt is generated. SSPxIF must be cleared in software.
- Repeat steps 8 - 11 until all data has been transmitted.
- Software generates a Stop or Restart condition by setting the PEN or RSEN bits, respectively. Once the Stop/Restart condition is complete, hardware sets SSPxIF.
