stm32f103c8t6 : Problem in PWM generation on timer output channel
Finally, after some experiments I found what was going wrong, The problem wasn't really with the code, as I configured the PWM mode as Mode 2 the pulse is negative instead of Positive with PWM 1. So The signal is actually inverted. At duty cycle set to '0', the pulse will be at peak amplitude and LED will glow ( with active high configuration), also because of the fast blinking the decrease in the intensity is not clearly visible even at 50% duty cycle. I changed the duty cycle to about 80%-90% and I got the LED getting less illuminated.