2022-03-21 04:28 AM
I have a buffer of 24 values. When this buffer is fully transmitted I want the TIM PWM to stop. It sends out 4 more values after I stop the DMA in the pulse finished callback. Why does this happen?
Thanks in advance!
2022-03-21 05:41 AM
It probably just takes some time for HAL_TIM_PWM_PulseFinishedCallback to get called, during which time the additional pulses happen. What is the timescale here? Slow down the pulses by an order of magnitude and see if it still happens. You can use a repetition counter + onepulse mode to avoid this, or have the timer gated by another timer to have it enabled for an exact amount of time. You could also pad your buffer so values after 24 are either 0% or 100% duty cycle.
2022-03-21 06:26 AM
I had room to increase the CPU clock frequency and that did the trick. I've read into the repetition counter + onepulse mode and that also sounds like a great solution. Thanks for your time!