SAM4S2A Set F_CPU

F_CPU

SAM 32bitμ—μ„œλŠ” λͺ‡κ°€μ§€ 단계λ₯Ό 거쳐 μ΅œμ’… 클럭이 정해지기 λ•Œλ¬Έμ— F_CPUλŠ” 클럭 κ΄€λ ¨ ν•¨μˆ˜ 맀크둜둜 μ •μ˜λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.

Examples

120MHz system clock을 μ–»κΈ° μœ„ν•΄ μ•„λž˜μ™€ 같이 값을 κ²°μ •ν•©λ‹ˆλ‹€.

  • Internal 12MHz RC oscillator
  • System clock source: PLLA
  • System clock prescaler: 2 (divided by 2)
  • PLLA source: Internal 12MHz RC oscillator
  • PLLA output: Internal 12MHz RC oscillator * 20 / 1
  • System clock: 12 * 20 / 1 / 2 = 120MHz

μœ„μ—μ„œ κ²°μ •λœ 값을 λ°”νƒ•μœΌλ‘œ src\config\conf_clock.hλ₯Ό μ„€μ •ν•˜λ©΄ μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_PLLACK
#define CONFIG_SYSCLK_PRES SYSCLK_PRES_2
#define CONFIG_PLL0_SOURCE PLL_SRC_MAINCK_12M_RC
#define CONFIG_PLL0_MUL 20
#define CONFIG_PLL0_DIV 1
Last updated on