The role of crystal oscillator in a single-chip - Database & Sql Blog Articles

Single chip microcomputer STM32L151CCU6
Crystal oscillator
1206RGB (single)
EPSON patch crystal

When the microcontroller is working, the instructions are taken from the RoM one by one, and then executed step by step. The time that the microcontroller accesses the memory is called a machine cycle, which is a time base. - A machine cycle consists of 12 clock cycles. If a microcontroller selects a 12MHz crystal, its clock period is 1/12us, and its one machine cycle is 12×(1/12)us, which is 1us.
Some of the MCS-51 microcontrollers are faster to complete, as long as one machine cycle is on the line, some are more complete, two machine cycles are required, and two instructions require four machine cycles. In order to measure the length of instruction execution time, a new concept is introduced: the instruction cycle. 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 the completion of the DJNZ instruction, the frequency of the crystal oscillator must first be known. If the crystal oscillator used is 12 MHz, then one machine cycle is 1 us. The DJNZ instruction is a two-cycle instruction, so the execution is 2us. This instruction needs to be executed 500 times, exactly 1000us, which is 1ms.
The machine cycle is not only important for command execution, but the machine cycle is also the time base for the microcontroller timer and counter. For example, if a single-chip microcomputer selects a 12MHz crystal oscillator, then when the value of the timer is increased by 1, the actual elapsed time is 1us, which is the timing principle of the microcontroller.
Simply put, without a crystal oscillator, the microcontroller does not have a clock cycle. Without a clock cycle, the program code cannot be executed, and the microcontroller cannot work.

External Axial Fan

External Axial Fan,External Rotor Fan,External Rotor Axial Fan,Axial Cooling Fan

Hangzhou Jinjiu Electric Appliance Co Ltd. , https://www.jinjiufanmotor.com