Skip to main content
Arajp
Visitor II
June 7, 2019
Question

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

  • June 7, 2019
  • 1 reply
  • 1138 views

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

This topic has been closed for replies.

1 reply

Jan Waclawek
Visitor II
June 7, 2019

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