cancel
Showing results for 
Search instead for 
Did you mean: 

how to switch PWM pins(complementary) into gpio high and low state .

Arajp
Associate

Hello,

I am trying to switch on pwm for 10 ms timer and then switch off pwm and use those pins as gpio (high and low) also for 10 ms. This whole process will work in loop.

We even tried to set idle state of pins as set and reset in cubemx but as we stop pwm ,pins didnt follow set and reset state .

Thank you

Apurva

1 REPLY 1
Jan Waclawek
Senior II

Switch the pins mode in GPIOx_MODER from AF to GPIO_Out.

Other way is to leave them as AF and switch the mode of the timer channel to Force Inactive or Forced Active, in respective TIMx_CCMRy.OCzM.

JW