2021-09-16 12:30 PM
I have 4 PWM out working fine on Tim3.Channel1,2,3,4
But the fifth PWM isn't working Tim15Chan2 (PB15=LQFP64pin36)
The pin works fine as GPIO so I know it is wired fine.
I even tried it as PWM Tim1.Chan3N and PWM Tim8.Chan3N but neither of those work either.
I don't see anything in L476 Errata.
Any idea what I'm doing wrong? What is difference between Tim15.2 PWM versus Tim3.2 PWM that would give me trouble?
Using latest STM32Cube MX, IDE, and Compiler.
Paul
Solved! Go to Solution.
2021-09-17 02:35 PM
All TIM15 registers read as 0, that means that you either don't program TIM15, or, more likely, you don't enable the TIM15 clock in RCC. Have a look at content of RCC_APB2ENR, TIM15EN is bit 16 in it.
GPIOB registers also doesn't seem right, the bitfield in GPIOB_MODER corresponding to PB15 is set to 0b11 which is Analog (you also wrote in that picture PB14, was that intentional?)
After you solve all that, make also sure TIM15_BDTR.MOE is set.
I don't use Cube/CubeMX so don't know how to fix it in that environment, sorry.
JW
2021-09-16 03:25 PM
Read out and check/post TIM15 and relevant GPIO registers content.
JW
2021-09-17 06:10 AM
2021-09-17 02:35 PM
All TIM15 registers read as 0, that means that you either don't program TIM15, or, more likely, you don't enable the TIM15 clock in RCC. Have a look at content of RCC_APB2ENR, TIM15EN is bit 16 in it.
GPIOB registers also doesn't seem right, the bitfield in GPIOB_MODER corresponding to PB15 is set to 0b11 which is Analog (you also wrote in that picture PB14, was that intentional?)
After you solve all that, make also sure TIM15_BDTR.MOE is set.
I don't use Cube/CubeMX so don't know how to fix it in that environment, sorry.
JW
2021-09-20 05:06 AM
JW,
Thank you, I will try your advice today
(My Typo, should have been PB15, I'll fix my doc)
I'll post solution here when it works.
Paul
2021-09-20 06:00 AM
JW,
It worked, your points led me to a bug in my own coding.
Thank you
Paul