2022-01-16 02:55 AM
Hey there
I want to use one and only one Timer to generate PWM signal to control 2 LED lights. assume that PWM generated is only attached to one the LEDs. how can I make both of LEDs shine or dim with only one PWM?
thanks in advance for any help and hint in advance
2022-01-16 06:50 AM
Your question lacks info what is your idea. One Timer in normal have more channels for example 4
You can create different duty PWMs on every channel.
Or when you ask how 2 LEDs use electrical serial or parallel or one transistor driver or two or ....
2022-01-16 08:12 AM
you are right MM.1! so here is my situation: one of the LEDs is connected to TIM so I can generate and control PWM.
but the other has no TIM channel connected to it! none what so ever...
my goal is to simultaneously dim or light these LEDs. say I use TIM14 CH1 which is connected to LED1. easily I can dim or shine LED1 using TIM14 CH1.
but LED2 has no TIM connected to it. but I still want to control its light with the same PWM I generated for LED1.
how can I do that?
2022-01-17 02:32 AM
Don't configure the GPIO of LED2 and add a wire to your board.
2022-01-17 02:37 AM
I already commented in your other similar question, you could do softpwm for both pins (extra fast points if both pins belong to the same GPIO port)
So no timer , and infinite number of PWms
https://www.hackster.io/javier-munoz-saez/all-pins-as-pwm-at-the-same-time-baremetal-stm32-1df86f
2022-01-17 02:42 AM
seems easy! but the thing is I just can not change the hardware...
I wondered if I can generate an internal PWM signal and logically OR it with this LED... but I don't know how?
2022-01-17 02:47 AM
Thanks Javier!@Javier Muñoz
I was just reading your comments. but I didn't understand it completely...I'll try to figure it out somehow though... how can I ask you if I face any conflict?
2022-01-17 03:44 AM
You can post your questions in this forum and tag my name so i dont miss it @Javier Muñoz
2022-01-17 05:00 AM
Simply Leave LED1 as is and in ISR timer interrupt add GPIO LED2 high and low.