[DONE][STM32F30x] 144MHz PWM
Posted: Fri Aug 08, 2014 7:44 pm
Hi All,
i finaly found the problem with setting the 144MHz Clock source for the advanced Timers.
As u can see the PLL is activated after the bits STM32_TIM1SW and STM32_TIM8SW were "set" but they are not set cause:
So these bits could not be set before the pll is running. They stay 0. I only moved the set of RCC->CFGR3 to the end of the function.
hope this solves the problem with the hal finally
.
Greetings
Tec
i finaly found the problem with setting the 144MHz Clock source for the advanced Timers.
Code: Select all
RCC->CFGR3 = STM32_UART5SW | STM32_UART4SW | STM32_USART3SW |
STM32_USART2SW | STM32_TIM8SW | STM32_TIM1SW |
STM32_I2C2SW | STM32_I2C1SW | STM32_USART1SW;
#if STM32_ACTIVATE_PLL
/* PLL activation.*/
RCC->CR |= RCC_CR_PLLON;
while (!(RCC->CR & RCC_CR_PLLRDY))
; /* Waits until PLL is stable. */
#endif
As u can see the PLL is activated after the bits STM32_TIM1SW and STM32_TIM8SW were "set" but they are not set cause:
The bit is writable only when the following conditions occur: clock system = PLL, and AHB
and APB2 subsystem clock not divided respect the clock system.
The bit is reset by hardware when exiting from the previous condition (user must set the bit
again in case of a new switch is required)
So these bits could not be set before the pll is running. They stay 0. I only moved the set of RCC->CFGR3 to the end of the function.
hope this solves the problem with the hal finally
Greetings
Tec