Main Content

Data Handling of QSPI Using Interrupts

This example shows the handling of QSPI data of array size 12 using interrupts for Infineon AURIX™ TC4x Microcontroller.

Model

Open the model tc4x_qspi_interrupts.slx.

This example uses both QSPI Tx and Rx interrupts that is mapped to Tx and Rx FIFO interrupts in the Hardware Mapping app.

QSPI Transmit

The QSPI data transmit is handled in two parts.

1. The initial QSPI data is transmitted using the QSPI Transmit1 block.

  • If the data length is up to 8 (say 'n' ), then n-1 is transmitted.

  • If the data length is greater than 8, then the initial 8 data elements are transmitted.

2. The subsequent data is handled by QSPI_Tx_interrupt block which triggers the QSPI Transmit2 block inside the Function call-Subsystem as highlighted.

For this example, the supported Tx FIFO mode is Batch move-1.

In Batch move-1, an interrupt is generated only at one point in the TXFIFO, when the filling level falls below the programmed threshold With the threshold set to 0 (recommended), the interrupt is triggered every time the data is transmitted from the TXFIFO buffer-0.

QSPI Receive

The data received is handled by QSPI_Rx_Interrupt block and triggers the QSPI Receive block inside the Function Call-Subsystem1 as highlighted. Ensure that the output data length specified in the QSPI Receive block matches the data that has been transmitted.

For this example, the supported Rx FIFO mode is Batch move-1.

In Batch move-1, an interrupt is generated only at one point in the RXFIFO, when the filling level rises above the programmed threshold. With the threshold set to 0 (recommended), the interrupt is triggered every time the data is received in the RXFIFO buffer.