Example: I/O Mode (Memory Reads and Writes) - Example: I/O Mode (Memory Reads and Writes) - 1.15 English - UG585

Zynq 7000 SoC Technical Reference Manual (UG585)

Document_ID
UG585
Release_Date
2026-02-06
Version
1.15 English

The sequence of operations uses I/O mode for reads and writes.

  1. Enable manual mode. Write 1 to qspi.Config_reg[Man_start_en, Manual_CS] = 1
  2. Configure the flash device. Refer to Table 1. Use reset values of the qspi.LQSPI_CFG register for a single flash device. In case of a parallel dual flash device, write 1 to the TWO_MEM, SEP_BUS bit fields.
  3. Assert chip select. Set qspi.Config_reg[PCS] = 0
  4. Enable the controller. Set qspi.En_REG[SPI_EN] = 1
  5. Write byte sequences to the flash memory. Write from 1 to 4 bytes to the TxFIFO using the TXD registers. Refer to I/O Mode Transmit Registers (TXD).
  6. Avoid TxFIFO overflow. When the TxFIFO is empty, 252 bytes can be written. After that, software can avoid overflowing the TxFIFO by reading qspi.Intr_status_REG[TX_FIFO_full] and waiting until it equals 0 before writing to a TXD register.
  7. Enable the interrupts. Write to qspi.Intrpt_en_REG. Interrupt handlers that handle the interrupt conditions are discussed in interrupt handlers section.
  8. Start data transfer. Set qspi.Config_reg[Man_start_com] = 1
  9. Interrupt handler: Transfer all the required data to QSPI flash during program/read operations to Quad-SPI flash. See Example: I/O Mode Interrupt Service Routine.
  10. If read operations are carried out: re-arrange the READ data to eliminate the data read due to dummy cycles.
  11. De-assert chip select. Set QSPI.Config_reg[PCS] = 1
  12. Disable controller. Set qspi.En_REG[SPI_EN] = 0

The TxFIFO width must be programmed to 32 bits: qspi.Config_reg[FIFO_WIDTH] = 0b11. Software needs to take care of “consecutive non word aligned” transfers.