Trigger LPSPI message every 300us periodically without CPU intervention

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

Trigger LPSPI message every 300us periodically without CPU intervention

789 Views
sambath_kumar_k
Contributor I

I am using S32k146.
what I need: Need to send 8 different SPI messages to slave periodically every 300us without CPU intervention. I found PIT can trigger SPI and SPI can trigger DMA for transfers of SOurce and results. 
Whereas I see some problem on, When the SPI will request to DMA transfer and how to do this periodically without CPU intervention.
Have anyone got the same design ?
#lpspi#s32k144 lpspi dma crc demo

0 Kudos
1 Reply

693 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi sambath_kumar_kardhik@cat.com,

What do you mean by PIT can trigger SPI?

The LPSPI module has an input trigger, but there have to be same data in the TX FIFO at the time the trigger is asserted.

pastedImage_2.png

pastedImage_3.png

LPSPI can request a DMA transfer when there are new data received [RDF = 1] or the TX FIFO is empty [TDF = 1].

pastedImage_4.png

LPIT can trigger DMA directly to transfer data to the LPSPI TX FIFO and start an LPSPI transfer.

A simple example is here:

https://community.nxp.com/docs/DOC-346587 

BR, Daniel

0 Kudos