2.2 Address Buffers and Registers

The I2C module has two Address Buffer registers, I2CxADB0 and I2CxADB1, that can be used as receive buffers in Client mode (see Table 2-2). This differs from the MSSP module in that the MSSP module only used the SSPBUF to receive or transmit an address (or data). The address buffers are enabled via the Address Buffer Disable (ABD) bit. When ABD is cleared, the address buffers are enabled; when the ABD is set, the address buffers are disabled.

When the ABD bit is cleared and in 7-bit Addressing mode, I2CxADB0 is loaded with the matching received client address and the R/W bit, and I2CxADB1 is unused. In 10-bit Addressing mode, I2CxADB0 is loaded with the lower eight bits of the matching received address, and I2CxADB1 is loaded with the upper eight bits of the matching address, including the R/W bit.

When the ABD bit is set and in 7-bit Addressing mode, I2CxRXB is loaded with the matching received client address and R/W bit, and neither I2CxADB0/1 are used. In 10-bit Addressing mode, I2CxRXB is loaded with both the high and low matching address bytes. In this case, user software must read I2CxRXB before the receive Shift register will load I2CxRXB with the matching lower address byte. I2CxADB0/1 are also unused in 10-bit Addressing mode.

Table 2-1. Address Buffer Direction for Client Modes
ModesMODE[2:0]I2CADB0I2CADB1
Client (7-bit)000RXUnused
001
Client (10-bit)010RXRX
011

The I2C module has four additional Client mode Address registers, I2CxADR0/1/2/3. These registers can hold up to four 7-bit client addresses or up to two 10-bit client addresses. The I2CxADR0/1/2/3 registers can also be used to form mask registers (see Table 2-2).

In 7-bit Addressing mode, all four registers can be used to store individual client addresses. The first byte received in a transmission (address byte) is independently compared to each of the values in the I2CxADR registers. The LSb of the received address byte (R/W bit) is not used in determining a match. If address masking is desired, I2CxADR1 holds the value that is used to mask the address loaded in I2CxADR0, while I2CxADR3 holds the value used to mask I2CxADR2.
Table 2-2. Client Mode Address Registers
ModesMODE[2:0]I2CADR0I2CADR1I2CADR2I2CADR3
7-bit0007-bit address7-bit address7-bit address7-bit address
7-bit w/masking0017-bit address7-bit mask for I2CxADR07-bit address7-bit mask for I2CxADR2
10-bit010Lower address byteUpper address byteLower address byteUpper address byte
10-bit w/masking011Lower address byteUpper address byteLower address maskUpper address mask

In 10-bit Addressing mode, I2CxADR0 and I2CxADR1 are combined to hold the 10-bit client address, while I2CxADR2 and I2CxADR3 are combined to hold a second 10-bit client address. I2CxADR0 and I2CxADR2 hold the lower eight bits of the 10-bit addresses, while I2CxADR1 and I2CxADR3 hold the upper two bits of the 10-bit addresses, with the R/W bits and the five digit ‘11110’ code assigned to the five Most Significant bits of the address high bytes. If address masking is desired, I2CxADR0 and I2CxADR1 are combined to form the 10-bit client address, while I2CxADR2 and I2CxADR3 are combined to form the 10-bit address mask. Address masking may be used to ignore the five-bit address code loaded into the Most Significant bits of the upper address byte.

Important: The ‘11110’ code is specified by the I2C Specification, but is not strictly enforced by Microchip. The user must ensure that the correct bit values are loaded into the 10-bit high address byte. If a host device has included that specific code in the address it intends to transmit, the client must also include those bits in the client address.