User manual

Table Of Contents
Zynq-7000 AP SoC Technical Reference Manual www.xilinx.com 606
UG585 (v1.11) September 27, 2016
Chapter 20: I2C Controller
20.2 Functional Description
20.2.1 Block Diagram
20.2.2 Master Mode
An I2C transfer can only be initiated by the APB host, and two types of transfers can be performed:
Write transfer, where the I2C becomes master transmitter
Read transfer, where the I2C becomes master receiver
Write Transfer
To accomplish an I2C write transfer, the host must perform these steps:
1. Write to the control register to set up SCL speed and addressing mode.
2. Set the MS, ACKEN, and CLR_FIFO bits and clear the RW bit in the Control register.
3. If required, set the HOLD bit. Otherwise write the first byte of data to the I2C Data register.
4. Write the slave address into the I2C address register. This initiates the I2C transfer.
5. Continue to load the remaining data to be sent to the slave by writing to the I2C Data register.
The data is pushed in the FIFO each time the host writes to the I2C Data register.
When all data is transferred successfully, the COMP bit is set in the interrupt status register. A data
interrupt is generated whenever there are only two bytes left for transmission in the FIFO.
When all data is transferred successfully, If the HOLD bit is not set, the I2C interface generates a STOP
condition and terminates the transfer. If the HOLD bit is set, the I2C interface holds the SCL line Low
X-Ref Target - Figure 20-2
Figure 20-2: I2C Peripheral Block Diagram
UG585_c20_02_030612
APB
Interface
Control
Register
SCL/SDA
Interface
TX Data
Register
RX Data
Register
Clock
Enable
Generator
Control
FSM
Status
Register
Interrupts
Interrupts
APB
RX Shift
Register