Aleksey_75 (19.12.2016 09:43, просмотров: 135) ответил _basile на У него ж ФАПЧ. Ты его, хоть на внешний кварц перестроил?
код
void HSE_Init(void)
{
uint32_t StartUpCounter = 0, HSEStatus = 0;
RCC->CR |= RCC_CR_HSEON;
do
{
HSEStatus = (RCC->CR & RCC_CR_HSERDY);
StartUpCounter ++;
}
while ((StartUpCounter < HSEStartUp_TimeOut) && (HSEStatus == 0));
if ((RCC->CR & RCC_CR_HSERDY) != RESET)
{
FLASH->ACR |= FLASH_ACR_PRFTBE;
FLASH->ACR &= ~FLASH_ACR_LATENCY;
FLASH->ACR |= FLASH_ACR_LATENCY_2;
RCC->CFGR |= RCC_CFGR_HPRE_DIV1;
RCC->CFGR |= RCC_CFGR_PPRE1_DIV4;
RCC->CFGR |= RCC_CFGR_PPRE2_DIV1;
RCC->CFGR2 = (uint32_t)(0);
RCC->CFGR &= ~(RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLSRC | RCC_CFGR_PLLMULL);
RCC->CFGR |= (RCC_CFGR_PLLXTPRE_PREDIV1 | RCC_CFGR_PLLMULL6);
RCC->CR |= RCC_CR_PLLON;
while((RCC->CR & RCC_CR_PLLRDY) == 0);
RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_SW));
RCC->CFGR |= (uint32_t)RCC_CFGR_SW_PLL;
while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS) != (uint32_t)0x08);
}
else
{
}
}