
A31G22x Clock Setting Guide
4. Clock Sources
21
Example 2
Figure 11 and the procedure listed below describe an example code that outputs PLL 48MHz frequency
using the HSE clock source that operates with 8MHz XTAL.
Figure 11. PLL Clock F/W Configuration Example 2
1.
Set XIN and XOUT pins and enable HSE clock source. At this time, f
PLLINCLK
is
8MH.
f
PLLINCLK
= 8MHz / 1 = 8MHz (SCU_CSCR<HSECON[3:0]> = 0x08)
2.
Configure the SCU_SCCR register:
①
Set PLLINCLKSEL bit to 1 (0x01).
②
Set MCLKSEL bits to 10 (0x10).
3.
Set R to 3. This allows the f
IN
value to be between 1MHz and 3MHz.
f
IN
/ (R + 1) = 8MHz / (3 + 1) = 2MHz