Example: Master Write Using Interrupt Method - Example: Master Write 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 write and clear the FIFO’s. Write 0x40 to i2c.Control_reg0.
  2. Clear Interrupts. Read and write back the read value to i2c.Interrupt_status_reg0.
  3. Enable Timeout, NACK, TX Overflow, Arbitration lost, DATA, Completion interrupts. Write 0x24F to the i2c.Intrpt_en_reg0 register.
  4. Enable bus HOLD logic. Set i2c.Control_reg0 [HOLD] if the write data count is greater than the FIFO depth.
  5. Calculate the space available in FIFO. Subtract the i2c.Transfer_size_reg0 value from the FIFO depth.
  6. Fill the data into FIFO. Write the data to i2c.I2C_data_reg0 based on the count obtained in step 5.
  7. Write the slave address. Write the address to the i2c.I2C_address_reg0 register.
  8. Wait for data to be sent. Check for i2c.Interrupt_status_reg0 [COMP] to be set.
    1. If further data is to be written, repeat steps 5, 6 and 8.
    2. If there is no further data, set i2c.Control_reg0 [HOLD] = 0.
  9. Wait for completion of transfer. Check for i2c.Interrupt_status_reg0 [COMP] to be set.