cancel
Showing results for 
Search instead for 
Did you mean: 

Stopping SPI clock in RXONLY mode

srdjan
Associate II
Posted on February 05, 2016 at 17:50

Hello,

I'm using SPI in RXOnly mode with DMA transfers. If I setup DMA to transfer 7 bytes, it does so correctly and it triggers TC interrupt, but the clock never stops and this forces the data to continue to stream from external AD converter. This ofcourse corrupts my next read because some of the bytes have already been transfered, before I enable my next DMA read.

I did notice that the CLK generation stops if I completely disable SPI in my DMA complete interrupt, but since this is not the highest priority interrupt, I might be late, and 1 or 2 SPI clocks may already be clocked out.

Is there something I'm missing, or not configuring properly? How do I setup the DMA to disable SPI clk generation after set amount of bytes is received? I'm using STM32L151 chip.

#stm32 #dma #spi #stm32l151
3 REPLIES 3
srdjan
Associate II
Posted on February 09, 2016 at 12:37

Somebody, any hint on this?

Posted on February 09, 2016 at 12:43

> Somebody, any hint on this?

Don't use the RXONLY mode?

JW

Mackay.Susan
Associate II
Posted on February 10, 2016 at 03:31

I'm still very much a beginner on these chips but I've seen similar things on other devices.

Make sure that the DMA is transferring the current number of ''values'' be they 8 or 16 bits. It can be quite easy to set up the DMA to transfer ''x'' 16-bit values while the SPI is in 8-bit mode.

Susan