2014-12-15 07:52 AM
Hi,
I am using STM32L152. I programmed some timers to output a repeated burst of pulses without any software interaction. Now I want SPI to transmit data from a buffer, one 16 bit word at each pulse, and repeat this with each burst, like this: 0x1234 - pause - 0x2345 - pause - 0x3456 - long pause - 0x1234 - pause - 0x2345 - and so on with the pause times given from the timers. At each transmit there should be a corresponding receive I would like to do this with DMA also without any software interaction except an interrupt in the long pause but currently I can't see how to do it. If I program three words for the DMA it will send them all at once in one stream, if I program one word I need to disable the channel and set it again for the next byte and also change the data address to the next value to be send. Any help is welcome Thanks a lot Martin2014-12-15 10:22 AM
You'd have the TIM (Update or CCx) trigger the DMA, not the SPI TXE
You could have a secondary DMA loading a TIMx->ARR or TIMx->CCRx2014-12-17 02:56 AM
Hi Clive,
thank you for the hint > You'd have the TIM (Update or CCx) trigger the DMA, not the SPI TXE Yes, thats it. I just had a misunderstanding of how DMA work, although I already did some DMA stuff. Well, still learning after all these years. Martin