I'm trying to use HRTIM to generate non-overlaping PWM pulses on 2 outputs, and be able to change which output is first in time. I've tried various methods and find when I change the output order, it corrupts the pulse lengths and they overlap.
Nulceo 64- F334R8.
Using Timer A on HRTIM1 to generate non-overlaping PWM pulses on 2 separate outputs. I use 4 CMP registers, defining the start and end time of each pulse (CMP1 = pulse 1 start, CMP2 = pulse 1 end, CMP3 = pulse 2 start, CMP4 = pulse 2 end).
I've tried 2 different methods of changing the pulse output order but both sometimes result in extra long pulses and on time overlap:
- Changing the Set and Reset registers
- Swapping content of CMP 1 with 3, and CMP 2 with 4.
I have enabled PREEN, so all the registers should be updated at the same time.
The output pulses are doing what I want EXCEPT when I change the order of outputs, sometimes both outputs end up being high at the same time, which would result in disaster.
Is there a standard/suggested way to achieve what I am trying to do?
Thanks,
Oliver.