How do I get TIM1 generating a PWM output using the repetition counter and DMA properly?
I don' think the TIM_DMA example in the STM32 F0 V1.10 work as described. I'm trying to use the example as the basis for using DMA to generate a PWM waveform, having each element repeated a number of times.
If you take the example and adjust it to output a sequence of 4 values rather than the 3 it's written with you only get 1 continuous PWM stream with no transitions. The repetition counter is set to 3, so you should see 4 cycles of each PWM waveform.
What I think is happening is that the DMA engine moves the memory pointer on every TIM1 cycle, but only updates the TIM1 register every 4 cycles. Because I've now got 4 items in the array moving on 4 cycles between each update means that there's no change in the value. By playing with the repetition count and number of samples in the array you can see this "aliasing" effect happening. What I was expecting was to have the pointer move on one step every 4 TIM1 cycles and update the PWM output at that point.
Is there something I'm doing wrong or it that just the way the PWM/DMA works on the STM32F0? If so, it seems a very strange way to do it as it really limits what you can do with the DMA.