20.5.4 Communicating As a Client

In some systems, particularly where multiple processors communicate with each other, the dsPIC33AK128MC106 device can communicate as a client, as illustrated in Figure 20-22. When the I2C module is enabled, the client is active. The client cannot initiate a message; it can only respond to a message sequence initiated by a host. The host requests a response from a particular client as defined by the device address byte in the I2C protocol. The client replies to the host at the appropriate times as defined by the protocol.

As with the host module, sequencing the components of the protocol for the reply is a user software task. However, the client detects when the device address matches the address specified by the user software for that client.

Figure 20-22. A Typical Client I2C Message: Multiprocessor Command/Status

After a Start condition, the client receives and checks the device address. The client can specify either a 7-bit address or a 10-bit address. When a device address is matched, the module will generate an interrupt to notify the user software that its device is selected. Based on the R/W status bit sent by the host, the client either receives or transmits data. If the client is to receive data, the client automatically generates the Acknowledge (ACK), loads the I2CxRCV register with the received value currently in the I2CxRSR register and notifies the user software through an interrupt. If the client is to transmit data, the user software must load the I2CxTRN register.