Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2016
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. RCC->CR|=RCC_CR_HSEON;
  2. while(!(RCC->CR&RCC_CR_HSERDY)){}; //wait for HSE
  3.  
  4. RCC->PLLCFGR|= RCC_PLLCFGR_PLLSRC_HSE; //PLL source = HSE
  5. RCC->PLLCFGR&= ~RCC_PLLCFGR_PLLM; //clear PLLM
  6. RCC->PLLCFGR|= RCC_PLLCFGR_PLLM_3; //PLLM = 8
  7. RCC->PLLCFGR&= ~RCC_PLLCFGR_PLLN; //reset value 192 tak chto obnulyaem
  8. RCC->PLLCFGR|= RCC_PLLCFGR_PLLN_3|RCC_PLLCFGR_PLLN_5|RCC_PLLCFGR_PLLN_6|RCC_PLLCFGR_PLLN_7; //PLLN = 232
  9. RCC->PLLCFGR&= ~RCC_PLLCFGR_PLLP; //PLLP = 2 (is reset value 0x00)
  10.  
  11. RCC->CR|=RCC_CR_PLLON;
  12. while(!(RCC->CR&RCC_CR_PLLRDY)){};
  13. RCC->CFGR &=~RCC_CFGR_SW;
  14. RCC->CFGR|=RCC_CFGR_SW_PLL;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement