2023-01-09 05:08 AM
I have configured the TIM1 with PWM CH1 and CH1N, with 62.KHz frequency .
I am getting the 180 degree phase shift for 50 % duty cycle .If i vary duty cycle to 30 % then CH1 =30% and CH1N will be 70 % and it is inverted .I need same duty cycle with 180 degree Phase on two PWM ports .
please can some one answer this how to achieve this ??
2023-01-09 05:16 AM
On the 'G4 you could use Asymmetric/Combined mode to arbitrarily phase-shift one or two waveforms, but for this particular application it's probably simpler to use plain PWM and center-aligned (up-down counting) mode.
JW
2023-01-10 12:53 AM
can you please share the required STM32cube IDE PWM Setting links or documents to test this
2023-01-10 06:00 AM
I don't use CubeIDE.
Individual timer modes are described in the Timer chapter of Reference manual.
JW
2023-01-10 06:57 AM
I believe he was referring to cubeMX
2023-01-10 07:01 AM
@Community member was refferring to this i believe.
Now you could play with TIM1->CR 1 and TIM->CR2(complement) to get what you wanted.
2023-01-10 01:08 PM
Interested in this too.
But such configuration outputs signals to separate channels (TIM1_CH and TIM1_CH2N). Can they be coupled to protect outputs from occasional high levels on both leading to short circuit?
In other words is it possible to output 30% duty on two pins, 180 degrees phase-shifted and protected with deadtime insertion using TIM1?
2023-01-10 02:05 PM
> In other words is it possible to output 30% duty on two pins, 180 degrees phase-shifted and protected with deadtime insertion using TIM1?
No.
JW
2023-01-10 02:21 PM
Thank you for your fast reply.
And what are the closest means to implement this? HRTIM?
2023-01-10 02:46 PM
I don't know HRTIM, but I doubt there's anything like this, i.e. hardware enforcement of mutual exclusivity of outputs.
So the closest means may be to implement it so that you don't make software errors in setting up the two channels. Or adding the "mutual exclusive" hardware externally.
JW