hello
i need 2 PWM from my stm32f407 with 180 degree phase shift. but i cant see this capability in timer block . how can i do this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-12 10:47 PM
i think if use master and slave timer can solve this problem but i dont know required configuration in simulink
- Labels:
-
STM32-MatTarget
-
STM32F4 Series
-
TIM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-12 11:13 PM
I don't know in simulink either, but first, read the TIM chapter in RM, and then
- set up both timers to PWM as you would normally, with the same period, but don't enable them run
- one timer will be master, so set up one of its spare channels to PWM with 50% duty (you don't need to assign a real pin to it in GPIO), assign that channel as TRGO source in TIMx_CR2.MMS
- the other timer will be slave, set up the master's TIM as TRGI source in TIMx_SMCR.TS and set it up for Trigger slave mode in TIMx_SMCR.SMS
- enable only master timer (by setting TIMx_CR1.CEN)
JW
PS Change your username to a normal nick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-12 11:22 PM
thank u;
is this setup available in stm32cubmx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-12 11:33 PM
Some TIM have N (negated) channel outputs, ie CH1 and CH1N​.
​
Others you could use 2 channels, with one in PWM1 mode and the other in PWM2 mode​, here the outputs would be the inverse of each other.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-12 11:36 PM
Maybe yes, I don't use CubeMX.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-12 11:52 PM
thank u;
it seems OK;i will check it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-13 12:26 AM
you know i want two PWM that one of them has an Ts/2 delay from another, so they are not inverse of each other
