stm32f303 timer1 motor control
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-05-27 10:36 PM
when used timer1 for motor control some time need active low side signal in program with hand not follow pwm out put how to do this
- disable all output timer
- wait for turn off time
- set io bit to active mode (reset or set )
- change pinout timer to out put gpio
any one know faster easy way
Solved! Go to Solution.
- Labels:
-
STM32 Motor Control
-
STM32F3 Series
-
TIM
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-05-27 10:56 PM
You don't need to stop the timer before changing the pin mode to output in GPIOx_MODER.
You can also use some of the FORCED output compare mode, see description of TIM_CCMRx register - but this will maintain the complementary channel in opposite state.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-05-27 10:56 PM
You don't need to stop the timer before changing the pin mode to output in GPIOx_MODER.
You can also use some of the FORCED output compare mode, see description of TIM_CCMRx register - but this will maintain the complementary channel in opposite state.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-05-30 8:30 PM
HI
THANKS YOUR MEANS THIS WAY
LL_TIM_ClearFlag_UPDATE( PWMTIMER );
while ( LL_TIM_IsActiveFlag_UPDATE( PWMTIMER ) == RESET ) ;
LL_TIM_OC_SetMode( PWMTIMER, LL_TIM_CHANNEL_CH1 ,LL_TIM_OCMODE_FORCED_INACTIVE);
LL_TIM_OC_SetMode( PWMTIMER, LL_TIM_CHANNEL_CH2 ,LL_TIM_OCMODE_FORCED_INACTIVE);
LL_TIM_OC_SetMode( PWMTIMER, LL_TIM_CHANNEL_CH3 ,LL_TIM_OCMODE_FORCED_INACTIVE);
FOR ACTIVE LOW SIDE AND AGAIN RETURN MODE PWM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-05-31 2:14 AM
If I understand correctly (I don't use Cube/LL), yes, but as I've said, this maintains the complementary channel (CHxN) in opposite state. You may or may not want that, that's upon you.
JW
