cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H745 Timer frequency problem

BVu
Associate III

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.

1 ACCEPTED SOLUTION

Accepted Solutions
BVu
Associate III

Sorry for the post. The board has the wrong HSE crystal.

View solution in original post

1 REPLY 1
BVu
Associate III

Sorry for the post. The board has the wrong HSE crystal.