2021-02-18 05:13 PM
I'm using stm32h745. CubeMX Clock Configuration shows APB1 and APB2 clocks are 120MHz, and APB1 and APB2 Timer Clocks are 240MHz (2 x 120). When i call HAL_RCC_GetPCLK2Freq(), HAL_RCC_GetPCLK1Freq(), they indeed return 120MHz. I use general purpose timer to generate PWM based on timer clock freq of 240MHz. PWM signal freq is way off. For example i use timer clock of 240MHz to compute a 53KHz PWM; scope shows 16.95KHz PWM instead. This is the same code used to calculate PWM freq, from timer clk freq, used on other projects so i know it works correctly. It seems the timer clk is not 240MHz but something else. If someone has knowledge of stm32h7 timer clock freq, please let me know.
Solved! Go to Solution.
2021-02-18 05:35 PM
Sorry for the post. The board has the wrong HSE crystal.
2021-02-18 05:35 PM
Sorry for the post. The board has the wrong HSE crystal.