Lesson 11: System Clock Setting

Every microcontroller needs clock signals. Clock signals are connected to all the components inside of a microcontroller, such as CPU, memory systems, digital and analog peripherals.They govern the speed at which the processor executes instructions, the data transfer rate of serial communication signals, the speed of timer, the synchronous signal for parallel communication protocols, and so much more.

The clock source comes in the form of an oscillator. Most microcontrollers have internal oscillators, and optional connections for external crystal oscillator.

  • Internal Oscillators are typically an R-C oscillator. R-C oscillators are easy to implement, but they are not precise, and can be affected by temperature, noise and voltage. Usually, the internal oscillators are used for producing lower frequency.
  • External Oscillators provide more accurate, stable and fixed frequency at the output. If you need external oscillator, you need to make sure that your oscillator can be supported form the microcontroller by checking the microcontroller's data sheet.

Most microcontrollers have Phase-Lock-Loop (PLL) circuits to provide difference clock frequencies that can be adjusted by software.