2013-01-04 01:12 AM
Hello all,
I am using STM32F2.Pll as clock source which uses HSE as PLL clock source. I want to set my System core clock to 24Mhz and i have done. And I read one of the comment in stm32f2xx_rcc.c which says ''SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must * be called whenever the core clock is changed * during program execution.''Q1:Since i have changed my core clock is it necessary to use update it or is it just during program execution. I read that AHB is derived from HCLK and PCLK1 and PCLK2 are derived from AHB. I am using SPI1 which uses APB2 clock.Q2:
I am using APB2 prescalar as 2. But I cannot see any clock on my scope when i probe the SCLK of SPI1. Even if send and receive many bytes . How does system clock effect my SCLK? Sorry for my stupid questions m a newbie to clocks and controllers Thanks #spi #system-clock
2013-01-21 06:53 AM
Hi,
Within the StandardLib examples, you can find under RCC directory an example that allow you to know if the new system clock (or others) meet what you expect or not. Check firstly if you get the 24Mhz. ST MCUTo give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2013-01-21 07:53 AM
Is this 24 MHz how you will always run the chip, or are you changing it more dynamically? If you change it a lot you'll need to adjust peripherals depending on it, USART baud rates, SPI clocks, etc.
You can output internal clocks via the MCO pins, use these to confirm internal functions. If 24 MHz is what you want, you should modify all parameters and subroutines in system_stm32f4xx.c to reflect your new settings.