2019-06-22 12:49 AM
HELLO,
I am trying to implement h bridge logic to convert dc to ac but i am not sure about the pin states of complementery pwm once it stop pwm on that and how to use those compl. pwms pins as gpios .
what i am actually trying to achieve is run compl pwm for 10 ms then stop stop pwm and switch pin state to gpio (one pin being set and other reset) and this process is loop.
THANKS ,
REGARDS
ARSHAD
2019-06-22 01:12 AM
What is the question?
JW
2019-06-22 01:18 AM
hello waclawek sir,
1. what will be state of pin once i stop pwm (complementery pwms).
2.and how to define their pin states.
thanks
2019-06-22 05:25 AM
That depends on what do you mean by "stop pwm".
Maybe the easiest way is to change the given channel's mode in its respective TIMx_CCMRy.OCxM, from one of the PWMs to one of the Frozen. That then gives the output levels, the CHxN being still complementary to CHx.
You can then change the levels either by changing TIMx_CCER.CCxP/CCxNP, without changing the pins to GPIO Out.
Or, you can change the pins to GPIO Out in the respective GPIOx_MODER register, and then you can manipulate their level simply by changing GPIOx_ODR, or better, through GPIO_BSRR, as with any other GPIO Out.
JW
2019-06-24 01:12 AM
hello waclawek sir,
thanks for help sir being newbie to stm32 mcu i am using hal libraries for stopping pwm.(HAL_TIM_PWM_Stop(&htim1, TIM_CHANNEL_1);)
sir can you please help how to
1. what will be state of pin once i stop pwm (complementery pwms).
2.and how to define their pin states.
using hal libraries.
thanks
arshad
2019-06-24 10:43 AM
I don't use Cube/HAL.
JW