The work of the one-chip computer is carried on under the unified pulse control. This pulse is issued by the clock circuit of the single-chip controller, that is, the clock circuit is used to generate the clock signal required for the operation of the single-chip. The one-chip computer itself is a complicated synchronous sequential circuit, in order to guarantee the realization of the synchronous working mode, the circuit should work strictly according to the sequence under the control of the only clock signal. The clock circuit is used to generate the clock signal for the microcontroller. And the clock circuit is divided into two kinds respectively, namely internal clock mode and external clock mode. <br>This text design adopts the internal clock mode in this way, the one-chip computer connects a high gain inverting amplifier to form the internal oscillator. The pins XTAL1 and XTAL2 are the input and output terminals of this amplifier, respectively. At the same time, a crystal or ceramic resonator is connected across both ends of XTAL1 and XTAL2 to form a stable self-excited oscillator, and the pulse signal sent out is directly sent to the internal clock generator. The capacitors C5 and C6 are usually chosen to be (30+ or -10) pf or so; when an external ceramic resonator is connected, it is chosen to be about 47 pf. Capacitors C5 and C6 have a fine-tuning effect on the frequency. In order to reduce the parasitic capacitance and better ensure the reliable operation of the oscillator, the resonator and capacitor should be installed as close as possible to the microcontroller chip. The internal clock generator is actually a divide-by-two flip-flop. The divide-by-two provides a two-phase clock signal for the microcontroller, namely phase signal 1 (P1) and phase signal 2 (P2), which drives the CPU to generate instructions for executing the instruction function. Machine cycle. Here we use a 12MHz crystal oscillator, which means that the clock cycle of the microcontroller is 1/12uS and the instruction cycle is 1uS. The higher the frequency of the crystal oscillator, the higher the oscillation frequency, as shown in Figure 3-14.
正在翻译中..