Skip to main content
papageno
Associate III
Jun 17, 2020 7:36 PM UTC
Solved

SPI full duplex mode 3 using DMA.

Hi guys,

Probably the question has been asked one million times but being new on this site, i did not find any clue. My problem is using STM32F446 on SPI1 with DMA2 addressing a device (ADIS16488) in 16bits SPI in mode 3. Polling works perfectly but seems a little time consuming for me. I tried the IT and DMA but I am facing a problem I cannot solve. When I want to perform a transfer in burst , let s say a 12x6bits array, in IT and DMA only a transfer only one halfword it succeeds, if more that one halfword, the second data on MISO is 0x0000. I think that my slave can not take the burst mode (stall time between data is 2µs min) and the second 16bits command is lost so I was wondering if there is a way to insert a little pause in the sck signal between two consecutive halfwords transfers in order to respect those 2µs.

I thank you for your help

olie

This topic has been closed for replies.
waclawek.jan
waclawek.janBest answer
Super User
Jun 17, 2020 8:16 PM UTC

Run TIM1 or TIM8 with a period of the 16-bit frame plus the delay. Use that timer to trigger DMA feeding the SPI Tx. Leave SPI Rx as it is now.

JW

2 replies

waclawek.jan
waclawek.janBest answer
Super User
Jun 17, 2020 8:16 PM UTC

Run TIM1 or TIM8 with a period of the 16-bit frame plus the delay. Use that timer to trigger DMA feeding the SPI Tx. Leave SPI Rx as it is now.

JW

papageno
papagenoAuthor
Associate III
Jun 17, 2020 8:20 PM UTC

Thanks Jan,

That's an interesting idea.

Olie