This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Inserting SPI transfer between PPI initiated SPI transfers?

Hi, I am have been using PPI to control SPI transfer in response to a GPIO interrupt.

The PPI initiated SPI transfer that reads an external device's register A and I would like to insert a SPI transaction in between two PPI initiated transfer, which will send a differnt commands to read register B.

I have tried to insert the transfer during the handler of the SPI event, and tried all sorts of configuration, such as disable PPI, abort SPI transfer and reinitialize the SPI. But the SPI then freeze in place and never continue its operations.

I am not sure if initiating transfer in the call back will cause problem but I can't find an alternative place to insert the transfer.

When register B data is available, there will be another interrupt which is less frequent than that of the interrupt from register A (which initiate the PPI transfer). However, since this interrupt and the interrupt from register A can happen asynchronously, I would not want to start a new transfer in the handler of the interrupt from register B.

Any way that this can be done? My goal is to initiate a new transfer in between the two interrupts from register A. Originally, I tried to do it in the handler as mentioned above so that I am sure the current transfer to read register A is finished.

Related