
December 22, 2003
Document No. 38-12011 Rev. *E
275
27.
I
2
C
This chapter explains the I2C block and its associated registers. The I2C communications block is a serial processor
designed to implement a complete I2C Slave and/or Master.
The I2C communications block is a serial to parallel proces-
sor designed to interface to the two-wire I2C serial commu-
nications bus. The block provides I2C specific support for
status detection and generation of framing bits, to eliminate
the need for excessive host processor intervention and
overhead.
The I2C block will directly control the data (SDA) and clock
(SCL) signals to the external I2C interface, through connec-
tions to two dedicated GPIO pins. The host firmware will
interact with the block through IO register reads and writes,
and firmware synchronization will be implemented through
polling and/or interrupts.
Functionality requirements include:
Master/Slave, Transmitter/Receiver Operation
I
Byte processing for low CPU overhead
I
Interrupt or Polling CPU interface
I
Master Clock Rates: 50K, 100K, 400K
I
Multi-Master Clock Synchronization
I
Multi-Master Mode Arbitration support
I
7- or 10-bit addressing (through firmware support)
I
SMBus operation (through firmware support)
I
Hardware functionality provides basic I2C control, data, and
status primitives. A combination of hardware support and
firmware command sequencing provides a high degree of
flexibility for implementing the required I2C functionality.
Hardware limitations:
1.
There is no hardware support for automatic address
comparison. When Slave mode is enabled, every slave
address will cause the block to interrupt the host and
possibly stall the bus.
2.
Since receive and transmitted data is not buffered, there
is no support for automatic receive acknowledge. The
host processor must intervene at the boundary of each
byte and either send a byte or ACK received bytes.
27.1
Architectural Description
The I2C block is designed to support a set of primitive oper-
ations and detect a set of status conditions specific to the
I2C protocol. These primitive operations and conditions are
manipulated and combined at the firmware level to support
the required data transfer modes. The host will set up con-
trol options and issue commands to the unit through IO
Writes and obtain status through IO Reads and interrupts.
The block operates as either a Slave, a Master, or both.
When enabled in Slave mode, the unit is always listening for
a Start condition, or sending or receiving data. Master mode
can work in conjunction with Slave mode. The Master sup-
plies the ability to generate the START or STOP condition
and determine if other masters are on the bus. For Multi
Master mode, clock synchronization is supported. If Master
mode is enabled and Slave mode is not enabled, the block
does not generate interrupts on externally generated Start
conditions.
27.1.1
Basic I2C Data Transfer
Figure 27-1
shows the basic form of data transfers on the
I2C bus with a 7-bit address format. (For a more detailed
description, see the I2C Specification, Version 2.1, by Phil-
lips Semiconductor).
Table 27-1. I2C Registers
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Enable
Master
Bit 0
Enable
Slave
Byte
Complete
Access
0,D6h
I2C_CFG
PSelect
Bus Error IE
Stop IE
Clock Rate
RW : 00
0,D7h
I2C_SCR
Bus Error
Lost Arb
Stop
Status
ACK
Address
Transmit
LRB
R : 00
0,D8h
I2C_DR
Data[7:0]
RW : 00
0,D9h
I2C_MSCR
Bus Busy
Master
Mode
Restart Gen
Start Gen
R : 00