STM32G431RB Two PWMs with 180 degree phase shift
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-09 5: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 ??
- Labels:
-
STM32G4 Series
-
TIM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-09 5: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-10 12:53 AM
can you please share the required STM32cube IDE PWM Setting links or documents to test this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-10 6:00 AM
I don't use CubeIDE.
​
Individual timer modes are described in the Timer chapter of Reference manual.
​
JW​
​
​
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-10 6:57 AM
I believe he was referring to cubeMX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-10 7: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-10 1: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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-10 2: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-10 2:21 PM
Thank you for your fast reply.
And what are the closest means to implement this? HRTIM?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-10 2: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
