Essential Microcontroller Knowledge You Must Read

Essential Microcontroller Knowledge You Must Read

Introduction

On February 15, 1946, the first electronic digital computer ENIAC was born, marking the arrival of the computer era.

ENIAC was a vacuum tube computer, with a clock frequency of only 100 kHz, but could perform 5000 addition operations in 1s. Compared to modern computers, ENIAC has many shortcomings, but its emergence opened a new era in computer science and technology, significantly impacting human production and lifestyle.

During the development of ENIAC, Hungarian mathematician John von Neumann served as an advisor to the development team and made significant contributions to the design of the plan.
In June 1946, von Neumann proposed the concepts of “stored program” and “binary operation”, further constructing the classic structure of computers consisting of arithmetic units, controllers, memory, input devices, and output devices.

Essential Microcontroller Knowledge You Must Read

The development of electronic computer technology has gone through five eras: vacuum tube computers, transistor computers, integrated circuit computers, large-scale integrated circuit computers, and ultra-large-scale integrated circuit computers. However, the structure of computers has not broken through the classic structure framework proposed by von Neumann.

Composition and Application Forms of Microcomputers

1. Composition of Microcomputers

In January 1971, Ted Hoff of Intel, in collaboration with a Japanese commercial communication company to develop a desktop calculator, compressed the original plan’s dozens of chips into three integrated circuit chips.
Two of the chips are used for program and data storage, while the other chip integrates the arithmetic unit, controller, and some registers, known as the microprocessor (i.e., Intel 4004). The microprocessor, memory, and I/O interface circuits together form a microcomputer. Each part is connected via address bus (AB), data bus (DB), and control bus (CB).

Essential Microcontroller Knowledge You Must Read

2. Application Forms of Microcomputers

From the application perspective, microcomputers can be divided into three types: multi-board machines (system machines), single-board machines, and microcontrollers.

Multi-board machines (system machines)

A multi-board machine is a microcomputer system where the microprocessor, memory, I/O interface circuits, and bus interfaces are assembled on a main board (i.e., microcomputer motherboard), and connected to keyboards, monitors, printers, floppy/hard disk drives, and optical drives through system buses and various peripheral adapter cards. Various adapter cards are plugged into the expansion slots of the motherboard, and installed in the same chassis as the power supply, floppy/hard disk drives, and optical drives, along with system software, forming a complete microcomputer system, referred to as a system machine.

The personal computers widely used today (PC) are typical multi-board microcomputers. Due to their good human-computer interface, strong functionality, and rich software resources, they are generally used for office or home tasks and scientific computing, classified as general-purpose computers, and have become the most commonly used tools in various fields of society.

Additionally, reinforcing the chassis of the system machine, designing the bottom plate into a small bottom plate structure without a CPU, and utilizing the expansion slots of the bottom plate to insert the motherboard and various measurement and control boards, forms an industrial PC. Due to its advantages of friendly human-computer interface and rich software resources, industrial PCs are often used as the host for industrial measurement and control systems.

Single-board machines

A single-board microcomputer is formed by assembling the CPU chip, memory chips, I/O interface chips, and simple I/O devices (keypad, LED display) on a printed circuit board, along with a monitoring program (firmware stored in ROM), forming a single-board microcomputer, abbreviated as a single-board machine. A typical product is TP801.

The I/O devices of single-board machines are simple, with fewer software resources, making them inconvenient to use. Initially, they were mainly used for teaching the principles of microcomputers and simple measurement and control systems, but they are now rarely used.

Microcontrollers

A microcontroller integrates a microprocessor, memory, and I/O interface circuits onto a single integrated circuit chip, thus forming a single-chip microcomputer, i.e., a microcontroller.

Essential Microcontroller Knowledge You Must Read

The original design purpose of computers was to improve data calculation speed and handle massive data calculations. Computers that accomplish this task are called general-purpose computers.

As computer technology developed, people discovered that computers also possess extraordinary capabilities in logic processing and industrial control. In the control field, people are more concerned about the low cost, small size, reliability of operation, and flexibility of control of computers.

Especially in application systems like smart instruments, smart sensors, smart home appliances, smart office equipment, cars, and military electronic devices, there is a demand to embed computers into these devices. Computers embedded in control systems (or devices) to achieve embedded applications are called embedded computers, also known as dedicated computers.

Embedded application computers can be classified into embedded microprocessors (like 386EX), embedded DSP processors (like TMS320 series), embedded microcontrollers (i.e., microcontrollers like the 80C51 series), and embedded system-on-chip (SOC).

Microcontrollers are small in size, low in price, and highly reliable, and their extraordinary embedded application forms have unique advantages in meeting embedded application needs.

Currently, microcontroller application technology has become the most commonly used technical means in electronic application system design, and learning and mastering microcontroller application technology has extremely important practical significance.

In summary, the development of microcomputer technology is trending in two directions: one represented by system machines as general-purpose computers, dedicated to improving computer processing speed while considering control functions during massive high-speed data processing; the other represented by microcontrollers as dedicated embedded computers, focusing on the integration of computer control functions within the chip while meeting the measurement and control needs of embedded objects while considering data processing.

The Development Process and Current Status of Microcontrollers

1. The Development Process of Microcontrollers

The technology of microcontrollers has developed rapidly, and the variety of products is dazzling. Looking at the entire development process of microcontroller technology, it can be divided into the following three main stages:

Formation Stage of Single-Chip Microcomputers

In 1976, Intel launched the MCS-48 series of microcontrollers. The early products of this series integrated: 8-bit CPU, 1K byte program memory (ROM), 64 bytes of data memory (RAM), 27 I/O lines, and 1 8-bit timer/counter.

The main feature of this stage is that it integrates CPU, memory, I/O interface, timer/counter, interrupt system, clock, and other components within a single chip, but the memory capacity is small, the address range is limited (not exceeding 4K), there is no serial interface, and the instruction system’s functionality is weak.

Performance Improvement Stage

In 1980, Intel launched the MCS-51 series of microcontrollers. This series integrates: 8-bit CPU, 4K byte program memory (ROM), 128 bytes of data memory (RAM), 4 8-bit parallel interfaces, 1 full-duplex serial interface, and 2 16-bit timers/counters. The addressing range is 64 K, and it integrates a Boolean processor with strong control functions to complete bit processing. The main feature of this stage is that the structural system is perfect, performance has greatly improved, and the control-oriented characteristics are further highlighted. Now, MCS-51 has become a recognized classic model of microcontrollers.

Microcontrollerization Stage

In 1982, Intel launched the MCS-96 series of microcontrollers. This series integrates: 16-bit CPU, 8K byte program memory (ROM), 232 bytes of data memory (RAM), 5 8-bit parallel interfaces, 1 full-duplex serial interface, and 2 16-bit timers/counters. The maximum addressing range is 64 K. It also has 8 channels of 10-bit ADC, 1 PWM (D/A) output, and high-speed I/O components.

In recent years, many semiconductor manufacturers have used the 8051 core of the MCS-51 series of microcontrollers, integrating many interface technologies, reliability technologies, and advanced memory technologies and processes into microcontrollers, producing a new generation of 80C51 series microcontrollers that are powerful and flexible in use. The main feature of this stage is that the peripheral circuits for measurement and control systems are enhanced, allowing microcontrollers to be conveniently and flexibly applied in complex automatic measurement and control systems and devices. Therefore, the term “microcontroller” better reflects the essence of microcontrollers.

2. Current Status of Microcontroller Products

With the continuous development of microelectronic design technology and computer technology, microcontroller products and technologies are changing rapidly. The current status of microcontroller products can be summarized in two aspects.

· The 80C51 series of microcontroller products are numerous, and a mainstream status has formed. The improvement in the computing speed of general-purpose microcomputers is mainly reflected in the increase in CPU bit count (16-bit, 32-bit, and even 64-bit), while microcontrollers focus more on product reliability, economy, and embedded nature. Therefore, the demand for increasing the CPU bit count of microcontrollers is not very urgent. Years of practical application have proven that the system structure of 80C51 is reasonable and the technology is mature. Thus, many microcontroller chip manufacturers are committed to enhancing the comprehensive functionality of 80C51 microcontroller products, forming the mainstream product status of 80C51. Recently launched products that are compatible with 80C51 include:

  • ​The AT89 series of microcontrollers introduced by ATMEL, which incorporates Flash memory technology;

    High-performance microcontrollers of the 80C51 and 80C552 series launched by Philips;

  • The W78C51 and W77C51 series of high-speed low-cost microcontrollers launched by Winbond;
  • The GMS90/97 series of low-voltage high-speed microcontrollers launched by LG;
  • The DS89C420 high-speed (50MIPS) microcontroller launched by Maxim;
  • The C8051F series of high-speed SOC microcontrollers launched by Cygnal, etc.

It can be seen that 80C51 has become the de facto mainstream series of microcontrollers, so this book focuses on 80C51 to discuss the principles and interface methods of microcontrollers.

· New non-80C51 structure microcontrollers are continuously being launched, providing users with a wider range of choices. While the 80C51 and its compatible products are popular, some microcontroller chip manufacturers have also launched some products with non-80C51 structures, notably:

  • The MCS-96 series of 16-bit microcontrollers launched by Intel;
  • The PIC series of RISC structure microcontrollers launched by Microchip;
  • The MSP430F series of 16-bit low-voltage, low-power microcontrollers launched by TI;
  • The AVR series of RISC structure microcontrollers launched by ATMEL, etc.

Characteristics and Application Areas of Microcontrollers

1. Characteristics of Microcontrollers

High Control Performance and Reliability

Microcontrollers are designed to meet industrial control needs, so their real-time control functions are particularly strong, and their CPU can directly operate on I/O interfaces, with bit operation capabilities that are unmatched by other computers. Additionally, since the CPU, memory, and I/O interfaces are integrated on the same chip, connections between components are compact, and data transmission is less susceptible to interference and environmental conditions, making microcontrollers highly reliable. Recently launched microcontroller products have integrated high-speed I/O interfaces, ADC, PWM, WDT, and other components, and further enhancements have been made in low voltage, low power consumption, serial expansion buses, control network buses, and development methods (such as in-system programming ISP).

Small Size, Low Price, Easy to Productize

Each microcontroller chip is a complete microcomputer. For large-volume dedicated applications, one can match and select from various microcontroller types, and also specifically design chips, ensuring a good correspondence between chip functions and applications. In terms of pin packaging of microcontroller products, some microcontrollers have reduced their pins to 8 or fewer, thus minimizing the size of the application system’s printed circuit board, reducing connectors, and simplifying installation. Among various modern electronic devices, microcontrollers have a good performance-to-price ratio. This is an important reason for the widespread application of microcontrollers.

2. Application Areas of Microcontrollers

Due to their good control performance and flexible embedded qualities, microcontrollers have gained extremely widespread applications in various fields in recent years. They can be broadly divided into the following aspects:

Smart Instruments

Microcontrollers are used in various instruments, enhancing their functionality and accuracy, making them smarter, while simplifying their hardware structure, thus facilitating the upgrade of instrument products. Examples include various smart electrical measurement instruments and smart sensors.

Mechatronic Products

Mechatronic products integrate mechanical technology, microelectronics technology, automation technology, and computer technology, characterized by intelligence. Microcontrollers can play a significant role in the development of mechatronic products. Typical products include robots, CNC machine tools, automatic packaging machines, bill counters, medical equipment, printers, fax machines, copy machines, etc.

Real-time Industrial Control

Microcontrollers can also be used for the collection and control of various physical quantities. The collection and control of physical parameters such as current, voltage, temperature, liquid level, and flow can be conveniently achieved using microcontrollers. In such systems, utilizing microcontrollers as system controllers allows different intelligent algorithms to be adopted based on the different characteristics of the controlled objects, achieving desired control indicators, thus improving production efficiency and product quality. Typical applications include motor speed control, temperature control, automatic production lines, etc.

Front-end Modules of Distributed Systems

In complex industrial systems, distributed measurement and control systems are often required to complete the collection of a large number of distributed parameters. In such systems, microcontrollers are used as front-end collection modules of the distributed system. The system has advantages such as reliable operation, convenient and flexible data collection, and low cost.

Home Appliances

Home appliances are another important application area for microcontrollers, with very broad prospects. Examples include air conditioners, refrigerators, washing machines, rice cookers, high-end bathing equipment, high-end toys, etc. Additionally, in the transportation field, microcontrollers are widely used in automobiles, trains, airplanes, spacecraft, etc. Examples include automobile automatic driving systems, aerospace measurement and control systems, black boxes, etc.

Introduction to Microcontroller Application System Development

1. Development of Microcontroller Application Systems

When designing microcontroller application systems, after completing the hardware system design, corresponding application software must be equipped. Accurate hardware design and good software functionality design are the design goals of a practical microcontroller application system. The process of achieving this goal is called the development of microcontroller application systems. A microcontroller, as an integrated circuit chip that integrates basic components of a microcomputer, does not have development functions compared to general-purpose microcomputers and must rely on development machines (a special computer system) to complete the following tasks: 1. Eliminate hardware faults and software errors in the application system; 2. The debugged program must be fixed into the internal or external program memory chip of the microcontroller.

Instruction Representation

An instruction is a command that tells the microcontroller to perform a certain operation. Inside the microcontroller, instructions are stored in the program memory in binary code in a specific order. Binary code is the machine code (also known as object code) that the computer can execute directly. For convenience in writing, inputting, and displaying, people usually write machine code in hexadecimal form. For example, the binary code 0000 0100B can be represented as 04H. The meaning of 04H corresponds to the instruction that adds 1 to the content of the accumulator A. If written as INC A, it is much clearer; this is called symbolic instruction representation.

Assembly or Compilation

Symbolic instructions must be converted into machine code that the computer can execute and stored in the computer’s program memory. This conversion is called assembly. There are three common assembly methods:

  • · Manual assembly, where designers refer to the microcontroller instruction encoding table to translate each symbolic instruction into hexadecimal representation of machine code, inputting it into the development machine via a keypad, then debugging, and writing the debugged program into the program memory chip.

  • · Using the assembly program of the development machine for assembly.

  • · Using the assembly program equipped with general-purpose microcomputers for cross-assembly, then transferring the object code to the development machine.

Additionally, high-level languages (such as C51) can be used for designing microcontroller application programs. The high-level language source program edited in the PC is compiled and linked to form an object code file, which is then transferred to the development machine. This method has advantages such as shorter cycles and convenience in portability and modification, making it suitable for developing more complex systems.

2. Traditional Development Methods for Microcontroller Application Systems

The microcontroller development system is also known as a development machine or emulator. The purpose of emulation is to use the resources of the development machine (CPU, memory, I/O devices, etc.) to simulate the CPU, memory, and I/O operations of the desired microcontroller application system (i.e., target machine) and track and observe the operating status of the target machine.

Emulation can be divided into software simulation emulation and online emulation using development machines. Software simulation emulation is cost-effective and easy to use but cannot perform real-time debugging and fault diagnosis of the application system’s hardware. Below, only the online emulation method will be introduced.

Development Using Standalone Emulators

Essential Microcontroller Knowledge You Must Read

Standalone emulators are made using the same type of microcontroller as the application system in a single-board format, equipped with LED displays and simple keyboards. This development system can perform online emulation of the microcontroller application system without the support of a general microcomputer system, facilitating debugging and modification of application software on-site.

Additionally, this development system is equipped with a serial interface to connect with general microcomputer systems. Thus, one can use the combination software equipped with general microcomputer systems for source program editing, assembly, and online emulation debugging. After debugging is error-free, the target program (i.e., machine code) can be transferred to the emulator for program fixing.

Development Using Non-Standalone Emulators

This type of emulator is constructed using a general microcomputer and emulator. The emulator is connected to the general microcomputer via serial communication. This development method requires the support of a microcomputer, using the combination software equipped with microcomputer systems for source program editing, assembly, and emulation debugging. Some emulation interfaces are also equipped with EPROM writing sockets, allowing the user application program to be written into the EPROM chip after development and debugging. Compared to the previous method, this development method is less convenient for on-site parameter modification and debugging.

Essential Microcontroller Knowledge You Must Read

Both of these development methods involve removing the microcontroller chip and program memory chip from the target system during development and inserting the emulator head drawn from the development machine, effectively lending the microcontroller from the development machine to the target machine.

Once emulation and debugging are error-free, the emulator head is removed and the microcontroller chip is reinserted, and the program that has been debugged in the development machine is fixed into the EPROM chip and inserted into the program memory socket of the target machine, allowing the target machine to operate independently.

3. Development Trends in Microcontroller Development Methods

With the widespread adoption of microcontroller chip packaging forms and the rapid development of Flash memory technology, the traditional concepts of microcontroller application system development will be impacted.

Using new microcontroller application system development technologies, microcontrollers can be installed on printed circuit boards first, and then programs can be downloaded to the target system via PC.

For example, SST has introduced the SST89C54 and SST89C58 chips with 20 KB and 30 KB of SuperFlash memory, allowing for high-speed reading/writing, and enabling in-system programming (ISP) and application programming (IAP) functionalities.

Application programs can be edited, assembled (or compiled), and simulated on a PC, followed by serial downloading of the target program.

Microchip has introduced the RISC structure microcontroller PIC16F87X, which has an inbuilt online debugger ICD function. The company also provides a simple emulator and programmer with ICSP functionality. As the chip contains detection circuit logic, it does not require additional hardware emulators.

Through a PC serial cable (containing a communication function module and a head connecting to the target board), simulation debugging of the target system can be completed.

Essential Microcontroller Knowledge You Must Read

Follow Video Account – EEPW Chip Perspective

Insight into the Chip World, Understanding Chip Trends

↓↓↓↓ Click Read Original to see more news

Leave a Comment

Your email address will not be published. Required fields are marked *