Why does a Single-chip Microcomputer Need a Crystal Oscillator?

2023-12-29 JGHC News
crystal oscillator

First of all, one of the necessary conditions for a single-chip microcomputer to work normally is the clock circuit, so the single-chip microcomputer needs a crystal oscillator very much.


Crystal oscillator, whose full name is a quartz crystal oscillator, is a kind of oscillator with high precision and stability. Through a certain external circuit, it can generate a sine wave with stable frequency and peak value. When the single chip microcomputer is running, it needs a pulse signal as the trigger signal of its execution instructions. It can be simply imagined as follows: when the single chip microcomputer receives a pulse, it will execute one or more instructions.


Why does singlechip need a crystal oscillator?

 When the single chip microcomputer works, it takes instructions from the ROM one by one, and then executes them step by step. The time when a single chip computer accesses a memory is called a machine cycle, which is a time benchmark. A machine cycle includes 12 clock cycles. If a single chip computer chooses a 12MHz crystal oscillator, its clock period is 1/12μs, and its machine period is 12 × (1/12) μs, that is 1μS.


Among all the instructions of the MCS-51 single-chip microcomputer, some of them are completed relatively fast, as long as one machine cycle is enough, and some of them are completed relatively quickly, which requires two machine cycles and two instructions require four machine cycles. To measure the execution time of instructions, a new concept, the instruction cycle, is introduced. The so-called instruction cycle refers to the time when an instruction is executed. For example, when it is necessary to calculate the time required for djnz instruction to complete, the frequency of the crystal oscillator must be known first. If the crystal oscillator used is 12V Hz, then a machine cycle is 1μS. The djnz instruction is a two cycle instruction, so it executes 2μs once. If the instruction needs to be executed 500 times, exactly 1000 μS, that is, 1 ms.


The machine cycle is not only of great significance for instruction execution but also the time benchmark of the timer and counter. For example, if a single-chip microcomputer chooses a 12MHz crystal oscillator when the timer value is increased by 1, the actual elapsed time is 1μS, which is the timing principle of the single-chip microcomputer.


Crystal oscillator provides the working signal pulse for MCU. This pulse is the working speed of the single chip microcomputer. For example, a 12 trillion crystal oscillator. The speed of single chip microcomputer is 12 megabits per second. There are crystal oscillator in the single chip microcomputer. With an external crystal oscillator, the frequency can be more stable.

  • +1 Like
  • Add to Favorites

Recommend

This document is provided by Sekorm Platform for VIP exclusive service. The copyright is owned by Sekorm. Without authorization, any medias, websites or individual are not allowed to reprint. When authorizing the reprint, the link of www.sekorm.com must be indicated.

Contact Us

Email: