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 slave transmission with AHEN enabled.
- Bus starts Idle.
- Master sends Start condition; the S bit is set; SSPxIF is set if interrupt on Start detect is enabled.
- Master sends matching address with R/W bit set. After the eighth falling edge of the SCL line the CKP bit is cleared and SSPxIF interrupt is generated.
- Slave software clears SSPxIF.
- Slave software reads the ACKTIM, R/W and D/A bits to determine the source of the interrupt.
- Slave reads the address value from the SSPxBUF register clearing the BF bit.
- Slave software decides from this information if it wishes to ACK or not ACK and sets the ACKDT bit accordingly.
- Slave sets the CKP bit releasing SCL.
- Master clocks in the ACK value from the slave.
- Slave hardware automatically clears the CKP bit and sets SSPxIF after the ACK if the R/W bit is set.
- Slave software clears SSPxIF.
- Slave loads value to transmit to the master into SSPxBUF setting the BF bit.Important: SSPxBUF cannot be loaded until after the ACK.
- Slave sets the CKP bit releasing the clock.
- Master clocks out the data from the slave and sends an ACK value on the ninth SCL pulse.
- Slave hardware copies the ACK value into the ACKSTAT bit.
- Steps 10-15 are repeated for each byte transmitted to the master from the slave.
- If the master sends a not ACK the slave releases the bus allowing the master to send a Stop and
end the communication.Important: Master must send a not ACK on the last byte to ensure that the slave releases the SCL line to receive a Stop.