C2000 hardware interrupt
10 ビュー (過去 30 日間)
I'm using a C2000 hardware target with the c28x_spi_interrupt_test_ert example model which generates an interrupt when SPI data is received. The interrupt calls a subsystem function block to processes the received data.
It appears the interrupt triggers the receive function continuously. How can the interrupt flag be reset so that the subsytem function is only trigger when the next SPI data is received?
回答 (1 件)
Aditya Padmanabha 2020 年 9 月 11 日
In the example, when you send data to SPI transmit block, the data continuously shifts of the transmit register. This in turn causes the data to be read back into the receive register which will be stored in receive FIFO. So you will keep on getting data in receive register as long as you send data using Transmit block.
Here we have configured the interrupt to be triggered when FIFO gets 4 or more receive values. Inside the interrupt subsystem, we have configured to read 4 words from receive block. Once the data is read the next receive interrupt is triggered only when the data received in FIFO becomes 4. This configuration is done by Browse to Hardware Implementation > Target Hardware Resources > SPI_A, select Enable Rx interrupt, and set FIFO interrupt level(Rx) to 4.
Also ensure SIMO, SOMI, CLK, and STE pin assignment are configured correctly so that the SPI reading of data is correct. Pick a proper STE pin value even though you are using internal loopback in order to get proper data while reading in SPI receive block.