Nitrof
Nitrof

Reputation: 151

stm32 with pin PWM capable : datasheet?

I want to build a project with an STM32G070.

I need a couple of PWM pins.

I look at the datasheet and user manual, and I cannot find anywhere if all pins of if only some are PWM capable and so, which one it is.

I want to know because, if I look at the BluePill, not all pins are PWM.

Can Anyone guide me ?

Upvotes: -1

Views: 1053

Answers (1)

pmacfarlane
pmacfarlane

Reputation: 4317

To answer the question - no, not all pins can be configured for PWM. However, most STM32s (including the STM32G070) have multiple timers, many with multiple channels which can generate PWM signals, and these can be mapped to many pins. So it's almost guaranteed that you'll find two spare pins that are not used by other peripherals, that you can use for PWM.

As mentioned, PWM signals are generated by timers. You can consult the reference manual for the STM32G070 to see which timers are available, and which ones have channels that can generate PWM signals. And you can reference the datasheet to see which pins they can be mapped to.

If I was designing a board, I'd create (e.g. in STM32CubeIDE) the crucial peripherals first (e.g. any SPI, I2C, UARTs, etc.) Then I'd see which pins are left over that could be used for PWM. There are bound to be several.

Upvotes: 0

Related Questions