Skip to main content
Associate III
May 23, 2025 11:41 PM UTC
Solved

Possible to setup SPI DMA transfer 2 words at a time paced by Timer? STM32H533RET6

So, I've got a circular transfer working, sending 24-bit words to a dual channel SPI DAC (with hardware NSS), paced by TIM2 and working well. For every edge of TIM2 a word is sent. Since this is a dual channel DAC, I would ideally like the transfer 2 words for each pulse of TIM2. So if I had a buffer [ADATA1, BDATA2, ADATA1, BDATA2, etc..], we would send ADATA1, and immediately (after the idle cycles setup for SPI) send BDATA1, then on the next trigger edge, do the same for ADATA2 and BDATA2.

 

Is this possible? Maybe with the 2D addressing channels?

 

I cannot simply set the timer exactly twice as fast as the one that my ADC is using or else they slightly loose sync and get really ugly jitter. Not sure what this is but it just won't work for me. With my ADC DMA and DAC using the same timer they are locked up perfectly and no jitter.

This topic has been closed for replies.
devinwBest answer
Associate III
May 24, 2025 12:25 AM UTC

Well well! I figured it out and indeed can be done!

 

Had to use one of the 2D addressing channels and set the source offset to 8 (2 words), and then set the burst source length to 2 and boom it's good to go!

1 reply

devinwAuthorBest answer
Associate III
May 24, 2025 12:25 AM UTC

Well well! I figured it out and indeed can be done!

 

Had to use one of the 2D addressing channels and set the source offset to 8 (2 words), and then set the burst source length to 2 and boom it's good to go!