LPSPI via DMA on i.MX RT1052

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

LPSPI via DMA on i.MX RT1052

798 Views
francescofiambe
Contributor I

Hello,

I have a custom board based on an i.MX RT1052 controlling an external ADC via LPSPI.
At every conversion, the ADC rises an end-of-conversion pin, which is connected to GPIO_AD_B0_02 of the MCU, and when the SPI chip select is set to low it outputs 16 bytes (16 bits for 8 channels) on the serial line.
I would like to exploit DMA for the data transfer from the ADC to the MCU, using the end-of-conversion signal as the source of the DMA request, in order to manage the data transfer completely without any intervention of the CPU.

I can route the end-of-conversion signal through XBARA to the DMA request for channel 30, and I verified that it can trigger a memory-to-memory DMA transfer in this way.

Then I need to setup the DMA transfer so that every minor loop is made of the 16 bytes corresponding to each conversion, with the major loop size to be set according to the number of samples required by the application.
Once the transfer is started and the DMA channel is enabled, I should get an interrupt at the end of the full transfer.

Is this kind of behavior attainable with this MCU?
Do you have any examples of this setup?

Thank you.

Best regards,
Francesco

Labels (1)
0 Kudos
2 Replies

456 Views
anasnadukkandiyil
Contributor III

I have a similar use case Let me know whether you are able to achieve this

0 Kudos

770 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Francesco,

I haven’t seen a similar implementation and there are no examples with this specific setup on the SDK, but it should be feasible given that you were able to route the end of conversion signal to trigger a DMA.

Hopefully some other community users may comment on similar implementations.

Regards,
Gustavo

0 Kudos