Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
stm32:peripherals:rcc_clock [2016/10/14 07:06] – [Clock Ratios] feurstm32:peripherals:rcc_clock [2022/12/27 19:27] (current) – [Setup System Clocks] ruan
Line 1: Line 1:
-====== Setup System Clocks ======+====== RCC Setup System Clocks ======
  
 To setup the system clocks you have to: To setup the system clocks you have to:
Line 100: Line 100:
 uint32_t reg; uint32_t reg;
  
-RCC->CFGR |= (0x8 << 4u);             /* HPRE: HCLK => 168 MHz / 2 => 84 MHz */ +RCC->CFGR |= (0x8 << 4u);             /* HPRE:  HCLK  => 168 MHz / 2 => 84 MHz */ 
-RCC->CFGR |= (0x4 << 10u);            /* PPRE1: PCLK1 => 84 MHz / 2 => 42 MHz */ +RCC->CFGR |= (0x4 << 10u);            /* PPRE1: PCLK1 =>  84 MHz / 2 => 42 MHz */ 
-RCC->CFGR |= (0x0 << 13u);            /* PPRE2: PCLK2 => 84 MHz / 2 => 42 MHz  +RCC->CFGR |= (0x0 << 13u);            /* PPRE2: PCLK2 =>  84 MHz / 2 => 42 MHz  
-                                                TCLK => 84 MHz • 2 => 84MHz */+                                                TCLK  =>  42 MHz • 2 => 84MHz */
  
 RCC->CFGR |= (0x2 << 0u);             /* Choose PLLCLK as input. */ RCC->CFGR |= (0x2 << 0u);             /* Choose PLLCLK as input. */
Line 115: Line 115:
 ===== Configuration Registers ===== ===== Configuration Registers =====
  
-==== CR ==== +==== CR - Control register ====
- +
-Control register+
  
 \\ {{clock_reg_cr.svg}} \\ \\ \\ {{clock_reg_cr.svg}} \\ \\
Line 131: Line 129:
 |:::|1|X ready| |:::|1|X ready|
  
-==== PLLCFGR ====+==== CSR - Control and status register ====
  
-PLL configuration register+\\ {{clock_reg_csr.svg}} \\ \\ 
 + 
 +|< 100% 5em 5em >| 
 +|LSION|0|Internal low speed clock enabled| 
 +|:::|1|Internal low speed clock disabled (reset state)| 
 +|LSIRDY|0|Internal low speed clock **not** ready| 
 +|:::|1|Internal low speed clock ready (reset state)| 
 + 
 +==== PLLCFGR - PLL configuration register ====
  
 \\ {{clock_reg_pllcfgr.svg}} \\ \\ \\ {{clock_reg_pllcfgr.svg}} \\ \\
Line 147: Line 153:
 * Please refer to reference manual (p.162ff) for detailed explanation of register values. \\ \\ * Please refer to reference manual (p.162ff) for detailed explanation of register values. \\ \\
  
-==== CFGR ==== +==== CFGR - Configuration register ====
- +
-Configuration register+
  
 \\ {{clock_reg_cfgr.svg}} \\ \\ \\ {{clock_reg_cfgr.svg}} \\ \\
  • stm32/peripherals/rcc_clock.1476428763.txt.gz
  • Last modified: 2016/10/14 07:06
  • by feur