Advertisement
Guest User

Untitled

a guest
Dec 18th, 2019
475
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. Increasing the CPU frequency:
  2.  
  3. The sequence to go from Range 2 to Range 1 is:
  4. 1. Program the VOS bits to “01” in the PWR_CR1 register.
  5. 2. Wait until the VOSF flag is cleared in the PWR_SR2 register.
  6. 3. Adjust number of wait states according new frequency target in Range 1 (LATENCY bits in the FLASH_ACR).
  7. 4. Increase the system frequency
  8.  
  9. 1. Program the new number of wait states to the LATENCY bits in the Flash access control register (FLASH_ACR).
  10. 2. Check that the new number of wait states is taken into account to access the Flash memory
  11. by reading the FLASH_ACR register.
  12. 3. Modify the CPU clock source by writing the SW bits in the RCC_CFGR register.
  13. 4. If needed, modify the CPU clock prescaler by writing the HPRE bits in RCC_CFGR.
  14. 5. Check that the new CPU clock source or/and the new CPU clock prescaler value is/are taken into account
  15. by reading the clock source status (SWS bits) or/and the AHB prescaler value (HPRE bits),
  16. respectively, in the RCC_CFGR register.
  17.  
  18. Decreasing the CPU frequency:
  19. 1. Modify the CPU clock source by writing the SW bits in the RCC_CFGR register.
  20. 2. If needed, modify the CPU clock prescaler by writing the HPRE bits in RCC_CFGR.
  21. 3. Check that the new CPU clock source or/and the new CPU clock prescaler value is/are taken into account
  22. by reading the clock source status (SWS bits) or/and the AHB prescaler value (HPRE bits),
  23. respectively, in the RCC_CFGR register.
  24.  
  25. 4. Program the new number of wait states to the LATENCY bits in Flash access control register (FLASH_ACR).
  26. 5. Check that the new number of wait states is used to access the Flash memory by reading the FLASH_ACR register.
  27.  
  28. The sequence to go from Range 1 to Range 2 is:
  29. 1. Reduce the system frequency to a value lower than 26 MHz
  30. 2. Adjust number of wait states according new frequency target in Range 2 (LATENCY bits in the FLASH_ACR).
  31. 3. Program the VOS bits to “10” in the PWR_CR1 register.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement