时钟内部时钟倍频到32Mhz,有个MSI时钟一直没弄个明白怎么设置,希望大神能帮帮我!
void Clock_Init(void)
{
u8 i;
RCC_DeInit ( );
RCC_HSEConfig(RCC_HSE_OFF);
RCC_HSICmd(ENABLE);
while(RCC_GetFlagStatus ( RCC_FLAG_HSIRDY) == RESET )
{
}
FLASH_PrefetchBufferCmd(ENABLE);
FLASH_SetLatency(FLASH_Latency_1);
RCC_PLLConfig (RCC_PLLSource_HSI,RCC_PLLMul_4,RCC_PLLDiv_2);
RCC_HCLKConfig(RCC_SYSCLK_Div1); //AHB = SYSCLK 32M
RCC_PCLK2Config(RCC_HCLK_Div1) ;
RCC_PCLK1Config(RCC_HCLK_Div1);
RCC_PLLCmd(ENABLE);
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET) //PLL
{
}
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK) ;
while(RCC_GetSYSCLKSource()!= 0x0C) //每次都死在这里
{
}
} |