Initiating SPI transfer with GPIO and moving data without CPU involvement.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Initiating SPI transfer with GPIO and moving data without CPU involvement.

822 Views
loganw
Contributor I

I'm working with an i.MX RT1020 processor connected to an external SPI device. This external device contains a "data ready" pin which can be used as an input to the processor. I would like to use this pulse as a trigger mechanism to initiate a SPI transfer. Following the SPI transfer I would like to break up the received data and place it in my own data buffer. This process is laid out in the following figure:

pastedImage_1.png

Successive trigger events would place the data in the following way ( actual samples are different colors to show a different SPI transfer has occured ):

pastedImage_3.png

After reading through some of the RT1020 documentation, I'm fairly certain that all of this can be accomplished with DMA transfers ( and maybe some XBAR setup ). I've broken the process up into three steps labelled A, B, and C. All these events will chain off of one another. I think B and C will be as simple as setting up DMA channels. But I'm still not sure how process C would be triggered in that scenario. Is there a "SPI transfer done" flag that can be used to chain to the next DMA transfer?

What about process A? I think this involves a XBAR assignment which connects the GPIO to a DMA request signal. But I'm having a hard time finding software examples of this.

#i.mxrt1020#edma#xbar‌ lpspi master

0 Kudos
1 Reply

693 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Logan Witter,

Thank you for your interest in NXP Semiconductor products and
for the opportunity to serve you.
According to your description, step A and B is easy to be implemented by XBAR work with SPI together, however, about step C, the DMA is hard to transfer a successive block of data to different destination dozen, it can't divide the data actually when transferring the data.
1) Is there an "SPI transfer done" flag that can be used to chain to the next DMA transfer?
-- The scatter/gather feature of DMA can achieve it.
2) About the XBAR and DMA demos, please refer to the SDK library.
https://mcuxpresso.nxp.com/en/welcome

Hope it helps.


Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos