28.5.3.3 7-Bit Transmission with Address Hold Enabled

Setting the AHEN bit enables additional clock stretching and interrupt generation after the eighth falling edge of a received matching address. Once a matching address has been clocked in, CKP is cleared and the SSPxIF interrupt is set.

Figure 28-19 displays a standard waveform of a 7-bit address client transmission with AHEN enabled.

  1. Bus starts Idle.
  2. The host sends Start condition; the S bit is set; SSPxIF is set if interrupt on Start detect is enabled.
  3. The host sends matching address with the R/W bit set. After the eighth falling edge of the SCL line, the CKP bit is cleared and SSPxIF interrupt is generated.
  4. Client software clears SSPxIF.
  5. Client software reads the ACKTIM, R/W and D/A bits to determine the source of the interrupt.
  6. The client reads the address value from the SSPxBUF register, clearing the BF bit.
  7. Client software decides from this information if it wants to ACK or not ACK and sets the ACKDT bit accordingly.
  8. The client sets the CKP bit, releasing SCL.
  9. The host clocks in the ACK value from the client.
  10. Client hardware automatically clears the CKP bit and sets SSPxIF after the ACK if the R/W bit is set.
  11. Client software clears SSPxIF.
  12. The client loads the value to transmit to the host into SSPxBUF, setting the BF bit.
    Important: SSPxBUF cannot be loaded until after the ACK.
  13. The client sets the CKP bit, releasing the clock.
  14. The host clocks out the data from the client and sends an ACK value on the ninth SCL pulse.
  15. Client hardware copies the ACK value into the ACKSTAT bit.
  16. Steps 10-15 are repeated for each byte transmitted to the host from the client.
  17. If the host sends a not ACK, the client releases the bus allowing the host to send a Stop and end the communication.
    Important: The host must send a not ACK on the last byte to ensure that the client releases the SCL line to receive a Stop.
Figure 28-19. I2C Client, 7-Bit Address, Transmission (AHEN = 1)