English
Language : 

PIC18F47J53 Datasheet, PDF (310/586 Pages) Microchip Technology – 28/44-Pin, High-Performance USB Microcontrollers with nanoWatt XLP Technology
PIC18F47J53 FAMILY
20.5 I2C Mode
The MSSP module in I2C mode fully implements all
master and slave functions (including general call
support), and provides interrupts on Start and Stop bits
in hardware to determine a free bus (multi-master
function). The MSSP module implements the standard
mode specifications and 7-bit and 10-bit addressing.
Two pins are used for data transfer:
• Serial Clock (SCLx) –
RB4/CCP4/PMA1/KBI0/SCK1/SCL1/RP7 or
RD0/PMD0/SCL2
• Serial Data (SDAx) –
RB5/CCP5/PMA0/KBI1/SDI1/SDA1/RP8 or
RD1/PMD1/SDA2
The user must configure these pins as inputs by setting
the associated TRIS bits. These pins are up to 5.5V
tolerant, allowing direct use in I2C busses operating at
voltages higher than VDD.
FIGURE 20-7:
MSSPx BLOCK DIAGRAM
(I2C™ MODE)
Read
Internal
Data Bus
Write
SCLx
SDAx
SSPxBUF reg
Shift
Clock
SSPxSR reg
MSb
LSb
Match Detect
Address Mask
Addr Match
SSPxADD reg
Start and
Stop bit Detect
Set, Reset
S, P bits
(SSPxSTAT reg)
Note: Only port I/O names are used in this diagram for
the sake of brevity. Refer to the text for a full list of
multiplexed functions.
20.5.1 REGISTERS
The MSSP module has six registers for I2C operation.
These are:
• MSSPx Control Register 1 (SSPxCON1)
• MSSPx Control Register 2 (SSPxCON2)
• MSSPx Status Register (SSPxSTAT)
• Serial Receive/Transmit Buffer Register
(SSPxBUF)
• MSSPx Shift Register (SSPxSR) – Not directly
accessible
• MSSPx Address Register (SSPxADD)
• MSSPx 7-Bit Address Mask Register (SSPxMSK)
SSPxCON1, SSPxCON2 and SSPxSTAT are the
control and status registers in I2C mode operation. The
SSPxCON1 and SSPxCON2 registers are readable and
writable. The lower six bits of the SSPxSTAT are
read-only. The upper two bits of the SSPxSTAT are
read/write.
SSPxSR is the shift register used for shifting data in or
out. SSPxBUF is the buffer register to which data
bytes are written to or read from.
SSPxADD contains the slave device address when the
MSSP is configured in I2C Slave mode. When the
MSSP is configured in Master mode, the lower seven
bits of SSPxADD act as the Baud Rate Generator
(BRG) reload value.
SSPxMSK holds the slave address mask value when
the module is configured for 7-Bit Address Masking
mode. While it is a separate register, it shares the same
SFR address as SSPxADD; it is only accessible when
the SSPM<3:0> bits are specifically set to permit
access. Additional details are provided in
Section 20.5.3.4 “7-Bit Address Masking Mode”.
In receive operations, SSPxSR and SSPxBUF
together, create a double-buffered receiver. When
SSPxSR receives a complete byte, it is transferred to
SSPxBUF and the SSPxIF interrupt is set.
During transmission, the SSPxBUF is not
double-buffered. A write to SSPxBUF will write to both
SSPxBUF and SSPxSR.
DS39964B-page 310
Preliminary
 2010 Microchip Technology Inc.