User manual

Table Of Contents
Zynq-7000 AP SoC Technical Reference Manual www.xilinx.com 612
UG585 (v1.11) September 27, 2016
Chapter 20: I2C Controller
Interrupt Status Register
All the bits are sticky.
Read: Reads interrupt status.
Write: Write 1 to clear
Status Register
All bits present the raw status of the interface. Bits in this register dynamically change based on FIFO and
other conditions.
20.3 Programmers Guide
20.3.1 Start-up Sequence
1. Reset controller: Programming resets is described in section 20.4.2 Reset Controller.
2. Configure I/O signal routing: I2C signals SCL and SDA can be routed to either MIO or EMIO.
Refer to Table 20-4. Example of I2C SCL and SDA signal routed to MIO is provided in section
20.5.1 Pin Programming.
3. Configure Clocks: The I2C clock architecture is described in section 20.4.1 Clocks.
4. Controller Configuration: Program I2C transfer parameters using i2c.Control_reg0 etc. Refer to
section 20.4.2 Reset Controller.
5. Configure Interrupts: Interrupts help to control data in FIFO. Refer to section 20.2.8 Status and
Interrupts and programming example in section 20.3.3 Configure Interrupts.
6. Data Transfers: Transfers in master mode and slave monitor mode can be referred in section
20.3.4 Data Transfers.
20.3.2 Controller Configuration
The user should choose interface mode, addressing mode, direction of transfer, timeout, and
program the I2C bus speed before initiating an I2C transfer. Optionally, the user can clear FIFOs and
hold the bus if required, in case of large data or combined transfers.
Example: Master Write Transfer
1. Configure the Control parameters. Write 0x0000_324E to the i2c.Control_reg0 register:
a. Select Master mode: Set i2c.Control_reg0[MS] = 1.
b. Set Direction of transfer as Master Transmitter: Set i2c.Control_reg0[RW] = 0.
c. Select Normal Addressing [7-bit] mode: Set i2c.Control_reg0[NEA] = 1.
d. Enable the transmission of ACK: Set i2c.Control_reg0[ACKEN] = 1.