AnsweredAssumed Answered

spl RCC config for external oscillator

Question asked by mahdi zamani on Jul 30, 2017
Latest reply on Aug 22, 2017 by mahdi zamani

hi 

i have connected #oscillator to #OSC_IN (PD0) i used this function for init #RCC at #STM32F103c8t6

but is not work with #pll and #external oscillator please help to me ...

 

 

 

void RCC_Configuration(void){
ErrorStatus HSEStartUpStatus;
RCC_DeInit(); /// RCC system reset(for debug purpose)
RCC_HSEConfig(RCC_HSE_Bypass); /// Enable HSE
HSEStartUpStatus = RCC_WaitForHSEStartUp(); /// Wait till HSE is ready
if(HSEStartUpStatus == SUCCESS)
{
RCC_HCLKConfig(RCC_SYSCLK_Div1); /// HCLK = SYSCLK
RCC_PCLK2Config(RCC_HCLK_Div1); /// PCLK2 = HCLK
RCC_PCLK1Config(RCC_HCLK_Div2); /// PCLK1 = HCLK/2
RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9); /// PLLCLK = 8MHz * 9 = 72 MHz
RCC_PLLCmd(ENABLE); /* Enable PLL */
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET); /// Wait till PLL is ready
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK); /// Select PLL as system clock source
while(RCC_GetSYSCLKSource() != 0x08); /// Wait till PLL is used as system clock source
}
}

thanks 

 

mahdi

oscillator 

Outcomes