cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling LED brightness using PWM frequnecy.

Rohit007
Associate II

Hii,

i am using stm32 G0B1RE Board and i want to control brightness of LED connected on PC8 using PWM frequency generated on PA15 pin. i dont know how to do it. as i am new to using stm32.

2 REPLIES 2
AScha.3
Chief II

Hi,

You have many timer - so why not just use a timer at the pin you want to switch ?

PC8 should be possible , to use : (from ds) 

AScha3_0-1705330949493.png

 

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

Hello @Rohit007

You can either connect your LED to a GPIO with a timer directly or simply wire the output of the PWM signal to the LED. The duty cycle of the PWM signal will determine the brightness of the LED 

For the code of PWM generation, you can refer to the existing examples in STM32CubeG0 FW by following this link 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.