Skip to main content
This topic has been closed for replies.

3 replies

Javierio
Associate II
November 27, 2019

Hello, it looks like PA2 is not connected to any PWM timer.

You could programm a (software) PWM using interruptions and toggling up and down the GPIO

JLEE.1706
JLEE.1706Author
Associate
November 27, 2019

Can you provide examples?

Because i am a new guy!!

Javierio
Associate II
November 27, 2019

can you use another pin?(maybe PA4)

What software are you using for developing in your PC?

JLEE.1706
JLEE.1706Author
Associate
November 27, 2019

YES ,I use cubeMX for the configuration

but ,hardware is ready ,so i can't switch.

JLEE.1706
JLEE.1706Author
Associate
November 27, 2019

you can see the picture , now pwm out is PB1

but i want switch to PA2

0690X00000AsWFfQAN.jpg

Javierio
Associate II
November 27, 2019

there is no PWM functionality in PA2.

PWM functionality is a feature some specific pins have, (because they can be connected to the timmer pwm outputs).

If the pin you want to use doesnt have that access to the pwm timmer function you need to create your own pwm thing.

How to do it:

Select your timmer in cubeMX, start the timmer as compare and match interruption.

Inside the ISR(interruption function) of the timmer you just configured put some gpio_toggle function or counters.

The rest is just playing around with it