cancel
Showing results for 
Search instead for 
Did you mean: 

Relationship between GPIO Interrupt and SPI Communication

pass3master
Senior

We are trying to do SPI communication in the GPIO interrupt handler.
We are not sure about the following two points. Can someone please give me an answer?

1, If another GPIO interrupt occurs while the GPIO interrupt handler is running (with the same priority), does it wait for the GPIO interrupt handler running first to complete before running the later GPIO interrupt handler?
Or is the later GPIO interrupt ignored?

2,We would like to disable GPIO interrupts during SPI communication in order to perform SPI communication in the GPIO interrupt handler.
How should we write the program?

10 REPLIES 10

@pass3master wrote:

Five switches are connected to a CPU (microcontroller), and FPGA.
Our customer requests that SPI communication be performed between the CPU (microcontroller) and FPGA when a switch is pressed.
Each of the five switches performs different SPI communication, and the moment a switch is pressed, there is a possibility that the other switches will also be pressed.
For this reason, we are planning to detect switch changes via GPIO interrupts and perform SPI communication.


Make sure the EXT preemption priority has the same level for all buttons + use EXTI interrupt mask register to mask/unmask the interrupt:

SofLit_0-1734949082213.png

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.