I am new to ARM MCUs and I have been trying to find my way around the peripherals using STM's HAL library and STM32Cube. I am having trouble in getting the PWM output to work. Here, I'm trying dim an LED (connected to PA6) on the STM32L100 Discovery Board by using the channel-1 PWM output of timer-3 at 50% duty cycle.
However, the LED doesn't turn on at all. I tried using the in-circuit debugging feature and it appears that the timer is not getting configured at all (despite the fact that I initialized it using HAL_TIM_PWM_Init()).
Any help would be appreciated. My main.c source code is attached below.
Line-96: main()
Line-148: Clock settings
Line-396: Timer Initialization routine
Line-463: GPIO Initialization routine
There are initialization functions for various other peripherals in the source file but I'm not using any of them right now. Jut timer and GPIO. I have used PWM features before on 8-bit MCUs like PICs, but the PICs that I used didn't have auto-reload features on their timer and hence, I had to use timer overflow interrupts to load back the timer register. However, timer-3 here has auto-reload and so I was unsure of whether I need interrupts. I tried looking up some example codes online and none of them seem to be using interrupts either.