C2000 hardware interrupt

조회 수: 5 (최근 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