![](http://datasheet.mmic.net.cn/260000/PIC16LC72_datasheet_15942878/PIC16LC72_83.png)
1995 Microchip Technology Inc.
DS30390B-page 83
PIC16C7X
11.2
I
Applicable Devices
70 71 71A 72 73 73A 74 74A
2
C
Overview
This section provides an overview of the Inter-Inte-
grated Circuit (I
C) bus, with Section 11.3 discussing
the operation of the SSP module in I
The I
C bus is a two-wire serial interface developed by
the Philips Corporation. The original specification, or
standard mode, was for data transfers of up to 100
Kbps. An enhanced specification, or fast mode, sup-
ports data transmission up to 400 Kbps. Both standard
mode and fast mode devices will inter-operate if
attached to the same bus.
The I
ensure reliable transmission and reception of data.
When transmitting data, one device is the “master”
(generates the clock), while the other device(s) acts as
the “slave.” All portions of the slave protocol are imple-
mented in the SSP module’s hardware, while portions
of the master protocol need to be addressed in the
PIC16CXX software. Table 11-2 defines some of the
I
2
C bus terminology. For additional information on the
I
2
C interface specification, refer to the Philips docu-
ment “The I
2
C bus and how to use it.” which can be
obtained from the Philips Corporation.
In the I
2
C interface protocol each device has an
address. When a master wishes to initiate a data trans-
fer, it first transmits the address of the device that it
wishes to “talk” to. All devices “l(fā)isten” to see if this is
their address. Within this address, a bit specifies if the
master wishes to read-from/write-to the slave device.
The master and slave are always in opposite modes
(transmitter/receiver) of operation during a data trans-
fer. That is they can be thought of operating in either of
these two relations:
Master-transmitter and Slave-receiver
Slave-transmitter and Master-receiver
In both cases the master generates the clock signal.
2
2
C mode.
2
2
C interface employs a comprehensive protocol to
The output stages of the clock (SCL) and data (SDA)
lines must have an open-drain or open-collector in
order to perform the wired-AND function of the bus.
External pull-up resistors are used to ensure a high
level when no device is pulling the line down. The num-
ber of devices that may be attached to the I
2
C bus is
limited only by the maximum bus loading specification
of 400 pF.
11.2.1
INITIATING AND TERMINATING DATA
TRANSFER
During times of no data transfer (idle time), both the
clock line (SCL) and the data line (SDA) are pulled high
through the external pull-up resistors. The START and
STOP conditions determine the start and stop of data
transmission. The START condition is defined as a high
to low transition of the SDA when the SCL is high. The
STOP condition is defined as a low to high transition of
the SDA when the SCL is high. Figure 11-7 shows the
START and STOP conditions. The master generates
these conditions for starting and terminating data trans-
fer. Due to the definition of the START and STOP con-
ditions, when data is being transmitted, the SDA line
can only change state when the SCL line is low.
FIGURE 11-7: START AND STOP
CONDITIONS
SDA
SCL
S
P
Start
Condition
Change
of Data
Allowed
Change
of Data
Allowed
Stop
Condition
TABLE 11-2:
I
2
C BUS TERMINOLOGY
Term
Description
Transmitter
The device that sends the data to the bus.
Receiver
The device that receives the data from the bus.
Master
The device which initiates the transfer, generates the clock and terminates the transfer.
Slave
The device addressed by a master.
Multi-master
More than one master device in a system. These masters can attempt to control the bus at the
same time without corrupting the message.
Arbitration
Procedure that ensures that only one of the master devices will control the bus. This ensure that
the transfer data does not get corrupted.
Synchronization
Procedure where the clock signals of two or more devices are synchronized.