C2000 hardware interrupt

8 views (last 30 days)
Mark Edwards
Mark Edwards on 9 Sep 2020
Answered: Aditya Padmanabha on 11 Sep 2020
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 Comment
Venkatesh Chilapur
Venkatesh Chilapur on 10 Sep 2020
Hi Mark,
Please connect to us at:
We may need your model and/or host a meeting to debug further.
This process becomes easy via our support channel.
Regards,
Venkatesh C

Sign in to comment.

Answers (1)

Aditya Padmanabha
Aditya Padmanabha on 11 Sep 2020
Hi Mark,
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.
Regards,
Aditya

Products


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!