Triggering SPI DMA transfer with interrupt

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
AlNo_3504021
Level 1
Level 1

Hello,

I'm trying to create an application which starts a SPI DMA transfer of 200 bytes every time there is a positive edge on one of the GPIO pins. Right now, I am polling the pin using CyU3PGpioGetValue and starting the DMA transfer on the positive edge by calling CyU3PSpiSetBlockXfer. However, this does not provide the speed that I need for my application, and the RTOS thread manager interrupting the execution of my application thread occasionally causes the application to miss the edge. I tried configuring a GPIO interrupt handler using the Api provided in cyu3gpio.h, but was unable to get CyU3PSpiSetBlockXfer to run inside of the ISR, as it seems like some API calls cannot be called within an interrupt handler. Is there any way to directly set the DMA controller to read SPI data in on an interrupt, or to allow for running a SPI transfer inside an ISR?

Thank you for any insight.

0 Likes
1 Solution

Hi,

Yes that's correct api has many checks to do before toggling the GPIO pin. These checks took time but they are necessary for correct operation. If you are sure that you are toggling the right GPIO pin then go ahead and use register access.

-Regards

Abhinav

View solution in original post

0 Likes
5 Replies