C2000 hardware interrupt
4 次查看(过去 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 个评论
Venkatesh Chilapur
2020-9-10
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
回答(1 个)
Aditya Padmanabha
2020-9-11
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
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!