LPC55S26 Fast SPI Using DMA

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

LPC55S26 Fast SPI Using DMA

1,541 Views
RBlight
Contributor I

I need to send 25 bytes using SPI several times within 100us.  I have tried using the  spi_dma_b2b_transfer_master example, modified for 12MHz baud, but this has a setup time of around 42us between transfers.  This seems to be because I have to setup the DMA every time I use it.  See attached file single_channel.

Is there a way to set this up once and send on demand?  

If not, the next best option is to chain several descriptors and fire in one go.  I have tried to get this going but without success.  See attached file chanied_descriptors.  This sends 8 bytes then stops but the frame signal continues for the full 25 bytes.  The delay between SPI sends is the same at 42us.

Any help would be much appreciated.

0 Kudos
Reply
1 Reply

1,525 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

First of all, pls check the SPI delay register as the following pic, which I copied from UM11126.pdf.

If you have set the register all zero, I suppose that the transfer interval between two transfer frame(25-bytes-transfer + transfer_Interval + 25-bytss-transfer + transfer_Interval.....) is too long, because during the transfer interval, the LPC is executing the DMA ISR, which includes the call-back function.

For you call-back function, I suppose it is too complicated, you have chain callback function, in the case, you have to simplify the callback function.

If you use DMA chaining mode, but the DMA isr is still executed, that is why the transfer interval is not improved.

 

xiangjun_rong_0-1669967678240.png

Hope it can help you

BR

XiangJun Rong

0 Kudos
Reply