How do the timers and counters of 8031 ​​microcontroller work?
INDUSTRIAL LCD DISPLAYS / IGBT MODULES DISTRIBUTOR

Infineon / Mitsubishi / Fuji / Semikron / Eupec / IXYS

How do the timers and counters of 8031 ​​microcontroller work?

Posted Date: 2024-02-03

8031 microcontroller controller

The controller of the 8031 ​​microcontroller consists of an instruction register, an instruction decoder, a reset circuit, a clock generator, timing control logic, a program counter, a program address register, a data pointer, a stack pointer, etc.

The clock generator is divided into internal mode and external mode. The internal mode realizes self-oscillation by connecting an external timing feedback circuit (generally a parallel circuit composed of quartz crystal oscillator and capacitor) to the XTAL1 and XTAL2 pins to generate an internal oscillation signal. The external method is achieved by inputting an external oscillation signal (0.5~16MHZ square wave) into XTAL1 or XTAL2.

The controller of the 8031 ​​microcontroller also includes concepts such as CPU timing (timing) and instruction cycle. Among them, the oscillation period is the pulse period output by the oscillator, the clock period is the internal clock signal period after the oscillation pulse is divided by 2, the machine cycle is 6 clock cycles forming a machine cycle, and the instruction cycle is in machine cycles, one The time the instruction was executed.

How do the timers and counters of 8031 ​​microcontroller work?

The timers and counters of the 8031 ​​microcontroller work through an internal clock source. Specifically, the input terminals of timer/counter T0 and T1 are both connected to the machine cycle signal, so their initial counting values ​​start counting from the machine cycle.

When the counter counts to a certain value, it will overflow and trigger the corresponding interrupt. For the timer, as long as the initial counting value of the counter is set, an interrupt can be generated regularly. For the counter, when an external event occurs, the initial counting value needs to be loaded into the counter and the counter can be started to start counting.

In practical applications, it is necessary to select appropriate timers and counters according to specific needs, and set the corresponding initial values ​​and startup methods. At the same time, it is also necessary to pay attention to the frequency of counting pulses and the selection of initial counting values ​​to ensure the accuracy and precision of counting.

In what scenarios will 8031 ​​microcontroller timers and counters be used?

The MSC51 is a series of microcontrollers based on the Intel 8051 instruction set architecture and is also widely licensed to other companies. The MSC51 microcontroller series has many different models and series. The following are some of the more common MSC51 microcontroller models:

1. AT89C51: This is the 8051 series of microcontrollers produced by Atmel, which has low power consumption and a wide range of applications.

2. P89C51: This is the 8051 series microcontroller produced by NXP (formerly Philips) Company, which has more functions and a variety of expansion interface options.

3. STC89C51: This is an 8051 series microcontroller produced by China STC Company. It has the characteristics of stable performance and low price.

4. MCS-51 series: Includes 8051 microcontroller product lines produced by Intel, Philips, Atmel, STMicroelectronics and other companies.

Due to the universality of the 8051 instruction set architecture and standard interface, multiple companies can produce compatible MSC51 microcontrollers. Therefore, there are many MSC51 microcontroller models produced by other manufacturers with similar functions and interfaces.

Each model of MSC51 microcontroller has different features and specifications, including specific performance, memory capacity, peripheral interfaces and expansion capabilities.

Review Editor: Huang Fei


#timers #counters #microcontroller #work