PWM: drive output low in disabled mode
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-15 7:26 AM
I'm using TIM1 for a 6-step motor control on a STM32F2xx. According of the table 4 in DM0004234 application note, I update OCxE and OCxNE at each commutation, to select a new step. When OCxE = 0 and OCxNE = 0, the output is disabled. In this case, the output seems to be in high impedance. I would rather have it in OFF-state (low Z). Is there a way to get this result?
Thanks for your help. Simon- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-15 7:33 AM
Change the pin configuration?
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
‎2014-04-15 8:00 AM
You mean switch the GPIO_mode to GPIO_Mode_OUT instead of GPIO_Mode_AF? I wanted to avoid this option if there is an alternative.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-15 8:21 AM
Hi
You can change the CNT reg of the counter to what ever you like (you may want to disable the TIM if you want it to stop counting). Change the value to greater/less than CMRR to change between high/low output- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-15 8:26 AM
Motors really aren't my thing, can't you play games with the enable, polarity and idle settings?
/* Channel 1, 2,3 and 4 Configuration in PWM mode */
TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_Timing;
TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;
TIM_OCInitStructure.TIM_OutputNState = TIM_OutputNState_Enable;
TIM_OCInitStructure.TIM_Pulse = 2047;
TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High;
TIM_OCInitStructure.TIM_OCNPolarity = TIM_OCNPolarity_High;
TIM_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Set;
TIM_OCInitStructure.TIM_OCNIdleState = TIM_OCNIdleState_Set;
If I wanted to tri-state the pins I'd pick an INPUT mode.
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
‎2014-04-15 8:27 AM
I don't want to put all the 6 outputs to off state but only one branch...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-15 8:31 AM
Ok, that's ST example, but when you put OCxE = 0 and OCxNE = 0, the corresponding output are in tri-state. I would prefer to have them in low impedance, to actively force the MOS OFF.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-15 8:37 AM
Try the
https://my.st.com/public/STe2ecommunities/motordriver_ics/default.aspx
?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
‎2014-04-15 8:54 AM
Ok! Thanks for the suggestion!
