How do I configure all of the timers to 216 MHz on the stm32f767zi?
- October 29, 2020
- 2 replies
- 1835 views
I have a Nucelo-F767ZI development board and am having difficulties configuring all of the timers to run at 216 MHz using the CubeMX tool.
According to the data sheet of the STM32F767xx, on page 38 all of the timers have a max clock speed of 216 MHz. Per the footnote on Table 6, the TIMPRE bit of the RCC_DCKCFGR register controls if some of these timers (specifically Timer 2) can run at either 108 or 216 MHz.
I have confirmed I can get Timer 1 to run at 216 MHz. When attempting to configure Timer 2 to run in the same manner, I observe half the rate (of the PWM signal configured).
This is all using mostly the HAL API and Clock Configuration in CubeMX. In the Clock Configuration, by changing HCLK to 216 MHz, APB2 runs at 216 MHz but APB1 runs at 108 MHz. This seems to explain my observations. I can't get the configuration to provide a solution to get both APB1 and APB2 to run at 216 MHz. In addition, and mostly due to my ignorance, I don't know which control is tied to the aforementioned TIMPRE bit. The reference manual suggests this is a timer prescaler control, but I see two timer prescalers (at least what I think APB1 and APB2 Prescaler might be).
I have attached two images. The first is the working clock configuration that solves successfully. The second, is my attempt to get both timers to run at 216 MHz, but an error is highlighted for PCLK1.
