The working principle of the internal clock circuit of the microcontroller

Infineon / Mitsubishi / Fuji / Semikron / Eupec / IXYS

The working principle of the internal clock circuit of the microcontroller

Posted Date: 2024-01-17

The MCU clock circuit (Clock Circuit) is an important part of the MCU system. It is used to provide the basic clock signal of the MCU to drive its internal timing and operations.

The clock signal is very important for the microcontroller. It determines the overall performance and working stability of the microcontroller. The clock signal is used for timing control and data synchronization, which synchronizes various operations in the microprocessor to the appropriate timing.

In a microcontroller, the clock signal is usually generated by a clock generator circuit, which can be a crystal oscillator (crystal oscillator), ceramic oscillator (ceramic oscillator) or other forms of clock sources. These clock sources oscillate at a certain frequency to generate stable clock signals, which are input to the clock input pin of the microcontroller through the clock circuit.

The clock circuit of the microcontroller can be divided into two types: internal clock and external clock:

1. Internal clock: Some microcontrollers have an internal clock generator, which generates a clock signal inside the chip. The internal clock is usually generated by an on-chip oscillation circuit, and the frequency is adjusted by setting registers or control bits.

2. External clock: Other microcontrollers require an external clock source, such as a crystal oscillator. The external clock source is usually provided by an external circuit (such as a crystal oscillator), which is connected to the clock input pin of the microcontroller through the circuit.

Clock circuits can also have other functions, such as dividers and phase-locked loop circuits (PLL). The frequency divider can divide the clock signal into lower frequencies for use by different modules, while the PLL can multiply or divide the input clock signal to obtain different clock frequencies.

The microcontroller clock circuit is a circuit used to generate a stable clock signal. It is the basis for the normal operation of the microcontroller and determines the operating speed and performance of the microcontroller. The specific design and configuration depend on the microcontroller model and application requirements.

The working principle of the internal clock circuit of the microcontroller

The clock circuit is an oscillator that provides a beat to the microcontroller. The microcontroller must perform various operations under the control of this beat. Therefore, the microcontroller will not work properly without a clock circuit. The clock circuit itself does not control anything, but you program the microcontroller to do the corresponding work according to the clock. There is a high-gain inverting amplifier in the MCS-51 microcontroller. The input terminal of the inverting amplifier is XTAL1 and the output terminal is XTAL2. The oscillation circuit and clock circuit composed of the amplifier together constitute the clock mode of the microcontroller. According to the different hardware circuits, the clock connection mode of the microcontroller can be divided into internal clock mode and external clock mode, as shown in Figure 1.

Internal clock schematic diagram Q (which is a self-oscillation circuit). In the internal clock circuit, a quartz crystal oscillator and two trimming capacitors must be connected across the XTAL1 and XTAL2 pins to form an oscillation circuit. Usually C1 and C2 are generally 3OpF, the frequency of the crystal oscillator is between 1.2MHz and 12MHz. For the external clock circuit, XTAL1 is required to be connected to ground and XTAL2 pin is connected to the external clock. There are no special requirements for the external clock signal, as long as a certain pulse width is ensured and the clock frequency is lower than 12MHz.The oscillation signal of the crystal oscillator is from

The XTAL2 end is sent to the internal clock circuit, which divides the oscillation signal by two to generate a two-phase clock signal P1 and P2 for use by the microcontroller. The period of the clock signal is called the state time S, which is twice the oscillation period. The P1 signal is valid in the first half cycle of each state, and the P2 signal is valid in the second half cycle of each state. The CPU uses the two-phase clocks P1 and P2 as the basic beat to coordinate the effective work of various parts of the microcontroller.

What is the use and function of the microcontroller clock circuit?

The microcontroller clock circuit plays a vital role in the microcontroller system and has the following uses and functions:

1. Timing control: The clock circuit of the microcontroller is used to provide an accurate clock signal and synchronize various operations to the correct timing through the timing controller. It allows you to execute instructions at specific intervals, allowing for precise time control and timing operations.

2. Data sampling and synchronization: The clock signal enables the microcontroller to accurately sample and synchronize external input/output data. It ensures reliable reading and transmission of data at the correct time.

3. In-chip modules work together: Different functional modules (such as CPU, memory, peripherals, etc.) inside the microcontroller usually run at different rates. The clock circuit can provide a unified clock signal to these modules so that they can work in harmony and maintain synchronized and consistent operation.

4. System stability and reliability: The stability of the clock signal is crucial to the stability and reliability of the microcontroller system. The stable clock signal generated by the clock circuit can ensure the normal operation and stable performance of the microcontroller, allowing it to work as expected.

5. Reduce power consumption: The clock circuit can help reduce the power consumption of the microcontroller by controlling the clock frequency and enabling/disabling specific modules. This is important in power-constrained applications where energy efficiency and battery life need to be optimized.

The microcontroller clock circuit plays a vital role in the microcontroller system. It provides basic timing control, data sampling and synchronization functions, allowing the microcontroller to work as expected, and provides a mechanism for collaborative work between different modules. The stability and reliability of the clock circuit directly affect the performance and stability of the microcontroller system.

Review Editor: Huang Fei

#working #principle #internal #clock #circuit #microcontroller