28.5.2.2 7-Bit Reception with AHEN and DHEN
Client device reception with the AHEN and DHEN set operate the same as without these options, with extra interrupts and clock stretching added after the eighth falling edge of SCL. These additional interrupts allow the client software to decide whether it wants to ACK the receive address or data byte, rather than the hardware. This functionality adds support for PMBus® that was not present on previous versions of this module.
This list describes the steps that need to be taken by client software to use these options for I2C communication. Figure 28-16 displays a module using both address and data holding. Figure 28-17 includes the operation with the SEN bit of the SSPxCON2 register set.
- The S bit is set; SSPxIF is set if interrupt on Start detect is enabled.
- Matching address with R/W bit clear is clocked in. SSPxIF is set and CKP cleared after the eighth falling edge of SCL.
- Client clears the SSPxIF.
- Client can look at the ACKTIM bit to determine if SSPxIF was after or before the ACK.
- Client reads the address value from SSPxBUF, clearing the BF flag.
- Client sets the ACK value clocked out to the host by setting ACKDT.
- Client releases the clock by setting CKP.
- SSPxIF is set after an ACK, not after a NACK.
- If SEN =
1
, the client hardware will stretch the clock after the ACK. - Client clears SSPxIF.Important: SSPxIF is still set after the ninth falling edge of SCL even if there is no clock stretching and BF has been cleared. SSPxIF is not set only if NACK is sent to the host.
- SSPxIF set and CKP cleared after eighth falling edge of SCL for a received data byte.
- Client looks at the ACKTIM bit to determine the source of the interrupt.
- Client reads the received data from SSPxBUF, clearing BF.
- Steps 7-14 are the same for each received data byte.
- Communication is ended by either the client sending an
ACK =
1
, or the host sending a Stop condition. If a Stop is sent and Interrupt on Stop Detect is disabled, the client will only know by polling the P bit.