Advanced timer 1 with DMA hangs if compare register equals 0
Hi!
I have NUCLEO H743-ZI board, and I am trying to create PWM sequence with advanced timer 1, by utilizing DMA feature.
Code is mostly generated by cubeMX.
I am using PWM mode 2, Center-aligned mode 1.
Code works, untill DMA loads into compare register (TIMx_CCR1 register) value 0, than it hangs.
After some digging through HAL code, and manual, I presume this happens because timer stops generating interrupts, which force DMA to load new values into compare register (TIMx_CCR1).
My theory is that interrupts are generated when counter gets bigger than compare value, which never happens (lowest counter value is zero, and zero is not higher than zero, thus no interrupt).
Now how to resolve this issue…..
TIMx DMA/interrupt enable register (TIMx_DIER) has flag „Bit 8 UDE: Update DMA request enable“, but enebling it did not help. Simultaneously I set flag „Bit 0 UIE: Update interrupt enable“, but to no avail, I am still stuck…..
Did anyone came across this problem, and how was it resolved?
At this moment I am not eager to limit lowest compare value to 1 (bigger than zero), because I am using two complementary outputs with dead time, and even a 1 cycle switch-over will cause visible output signal dip.
