进入STOP MODE
{
//使能电源管理单元的时钟
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
//进入停止模式,设置电压调节器为低功耗模式,等待中断唤醒
PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);
}
下面为中断唤醒
{
ErrorStatus HSEStartUpStatus;
//使能外部高速时钟,HSE
RCC_HSEConfig(RCC_HSE_ON);
//等待HSE 准备就绪
HSEStartUpStatus = RCC_WaitForHSEStartUp();
if(HSEStartUpStatus == SUCCESS)
{
#ifdef STM32F10X_CL
//Enable PLL2
RCC_PLL2Cmd(ENABLE);
//Wait till PLL2 is ready
while(RCC_GetFlagStatus(RCC_FLAG_PLL2RDY) == RESET)
{
}
#endif
// Enable PLL
RCC_PLLCmd(ENABLE);
// Wait till PLL is ready
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
{
}
//Select PLL as system clock source
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
// Wait till PLL is used as system clock source
while(RCC_GetSYSCLKSource() != 0x08)
{
}
}
}
.....可是中断唤醒后,时钟频率变了,好几倍,好像没有倍频一样。这是什么问题引起呢? |