void RCC_Configuration(void)
{
//----------ʹÓÃÍⲿRC¾§Õñ-----------
RCC_DeInit(); //³õʼ»¯ÎªÈ±Ê¡Öµ
RCC_HSEConfig(RCC_HSE_ON); //ʹÄÜÍⲿµÄ¸ßËÙʱÖÓ
while(RCC_GetFlagStatus(RCC_FLAG_HSERDY) == RESET); //µÈ´ýÍⲿ¸ßËÙʱÖÓʹÄܾÍÐ÷
//FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable); //Enable Prefetch Buffer
//FLASH_SetLatency(FLASH_Latency_2); //Flash 2 wait state
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 =72MHZ
RCC_PLLCmd(ENABLE); //Enable PLLCLK
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET); //Wait till PLLCLK is ready
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK); //Select PLL as system clock
while(RCC_GetSYSCLKSource()!=0x08); //Wait till PLL is used as system clock source
//---------´ò¿ªÏàÓ¦ÍâÉèʱÖÓ--------------------
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA,ENABLE); //ʹÄÜAPB2ÍâÉèµÄGPIOAµÄʱÖÓ
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC,ENABLE); //ʹÄÜAPB2ÍâÉèµÄGPIOCµÄʱÖÓ
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO,ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1,ENABLE);
//GPIO_PinRemapConfig(GPIO_Remap_USART1,ENABLE);
}
仿真时走到while(RCC_GetSYSCLKSource()!=0x08);这一句就死住了,高手请指点什么原因,谢谢! |