C2000 hardware interrupt

14 ビュー (過去 30 日間)
Mark Edwards
Mark Edwards 2020 年 9 月 9 日
回答済み: Aditya Padmanabha 2020 年 9 月 11 日
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
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
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

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by