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

6 replies

waclawek.jan
Super User
Nov 21, 2019 6:50 PM UTC

Start with something simpler: set the pin where the LED is to GPIO Out, and set it to 1, and you should see that LED is ON (if it's connected through resistor to GND). Try the same with setting output to 0. Only if that works, go for the timer.

JW

Tesla DeLorean
Guru
Nov 21, 2019 10:48 PM UTC

And use a scope for frequencies beyond perception of the human eye

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
JAlca
Associate III
Nov 23, 2019 8:20 PM UTC

I think User may be right and the frecuency is too high.

Try blinking the led every 500ms.

TIM1->PSC = (SystemCoreClock / 1000) - 1; //Now timer counts miliseconds

TIM1->ARR = 1000; //Count every second

TIM->CCR1 = 500; //Duty is 50%.

prashjain007
Associate
Nov 27, 2019 4:25 PM UTC

I tried blinking at every 500ms but still not working. Even for high freq, LED should glow without blinking.

waclawek.jan
Super User
Nov 27, 2019 6:04 PM UTC

Read out and check/post content of relevant GPIO and TIM registers.

JW