Example: Master Read Using Interrupt Method - Example: Master Read Using Interrupt Method - 1.15 English - UG585

Zynq 7000 SoC Technical Reference Manual (UG585)

Document_ID
UG585
Release_Date
2026-02-06
Version
1.15 English
  1. Set direction of transfer as read and clear the FIFO’s. Write 0x41 to i2c.Control_reg0.
  2. Clear interrupts. Read and write back the read value to i2c.Interrupt_status_reg0.
  3. Enable Timeout, NACK, RX overflow, Arbitration lost, DATA, Completion interrupts. Write 0x22F to i2c.Intrpt_en_reg0.
  4. Write read data count to transfer size register and hold bus if required. Write read data count value to i2c.Transfer_size_reg0. If read data count greater than FIFO depth, set i2c.Control_reg0 [HOLD].
  5. Write the slave address. Write the address to the i2c.I2C_address_reg0 register.
  6. Wait for data to be received into FIFO.
    1. If read data count is equal to or greater than FIFO depth, wait for i2c.Interrupt_status_reg0 [DATA] = 1. Read 14 bytes from FIFO. Decrement the read data count by 14 and if it is less than or equal to the FIFO depth, clear i2c.Control_reg0[HOLD]
    2. Otherwise, wait for i2c.Interrupt_status_reg0 [COMP] = 1 and read data from the FIFO based on the read data count.
  7. Check for completion of transfer. Check if read count reaches zero. Otherwise repeat from step 6.