Skip to content
_Salch_ edited this page Mar 16, 2026 · 3 revisions

Clocking system

System scheme alt HSI - Inner RC-oscillator
HSE - External quartz


First of all, we configure the clock source for the entire microcontroller. There are two main sources of clocking, the first is an internal RC oscillator, it is inaccurate with an error of 1%-2% and depends on temperature, the second is a external quartz resonator, it is accurate and does not depend on external conditions.

Here we specify the source an external quartz resonator with a clock frequency of 8 megahertz.

setSourceClocking(EXTERNAL_QUARTZ, 8 /*mHz*/);

Then, switch System Mux to connect the system directly to HSE (Quartz)
setSystemMux(EXTERNAL);

Clone this wiki locally