5_STM32 Clock and Configuration
5_STM32 Clock and Configuration
2
★Objectives:
3
STM32 Clock System
There are 5 clock sources in STM32F103:
HSI (High Speed Internal)
HSE (High Speed External)
LSI (Low Speed Internal)
LSE (Low Speed External)
PLL(Phase Locked Loop)
4
The clock tree of STM32F103 is shown in Fig.5-1
on page 115 of the STM32 Reference Manual (RM)
5
Fig.5-1 Clock tree
The clock tree of STM32F103 is shown in Fig.5-1
on page 115 of the STM32 Reference Manual (RM)
6
Fig.5-1 Clock tree
The clock tree of STM32F103 is shown in Fig.5-1
on page 115 of the STM32 Reference Manual (RM)
7
Fig.5-1 Clock tree
PLL is from HSI or
HSE
HSI, HSE or PLL can be used as System Clock
8
There are several clocks for MCU core and
different peripherals. Why?
9
First reason
High speed clock is used for high speed
devices, like CPU, and low speed clock is used
for low speed devices like peripherals.
Second reason
This mode of clock is helpful to realize low
power consumption.
10
Enable clock out
11
Clock configuration of STM32
In general, an embedded system should be initialized
before it works.
12
Clock configuration of STM32
The flow chart of clock setup is shown in Fig.5-2.
Enable HSE clock
They can be viewed in STM32 Reference Manual (RM) from page 121
14
‘7.3 RCC registers’