Skip to main content
SB.1
Visitor II
Aug 28, 2020 10:51 AM UTC
Solved

How can I generate a PWM on an GPIO? (pin can't configure as a timer output)

Hallo.

I wanna generate a PWM on an GPIO. I can't configure the pin in STM32MXCube as Timer output.

What can I do ?

This topic has been closed for replies.
TDK
TDKBest answer
Aug 28, 2020 2:49 PM UTC

Set up a periodic timer interrupt and toggle the pin in the interrupt. Timing won't be exact, but it may be good enough.

"If you feel a post has answered your question, please click ""Accept as Solution""."

1 reply

TDK
TDKBest answer
Aug 28, 2020 2:49 PM UTC

Set up a periodic timer interrupt and toggle the pin in the interrupt. Timing won't be exact, but it may be good enough.

"If you feel a post has answered your question, please click ""Accept as Solution""."