075582814553
What is a Microcontroller?

FREE-SKY (HK) ELECTRONICS CO.,LIMITED / 11-05 09:35

The microcontroller is a single-chip microcomputer that integrates the main part of the microcomputer on one chip. Microcontrollers are mainly used for automatic control equipment in the fields of automobile air conditioning and automatic machinery. Microcontrollers are widely used in various industrial and civil embedded systems due to their small size, low power consumption, and ease of use.

What is a Microcontroller?

Catalog

ⅠWhat is a microcontroller?

Ⅱ Types of microcontroller

Ⅲ What is the difference between a microcontroller and a microprocessor?

 

1 The role of the microcontroller

2 The basic functions of the device controller

3 The difference between a microprocessor and a microcontroller

 

Ⅰ What is a microcontroller?

A microprocessor is a computer. All computers-whether we say a personal desktop computer or a mainframe computer or a microcontroller-have a lot in common:

All computers have a CPU (Central Processing Unit) for executing programs. If you are sitting in front of a desktop computer and reading this article, the CPU of this computer is now executing a program, which is the web browser used to display this web page. The CPU loads the program from a device. On your desktop computer, the browser program is loaded from the hard disk. The computer has some RAM (random access memory) used to store "variables".

Besides, the computer has some input and output devices, so that it can exchange information with the user. On your desktop computer, the keyboard and mouse are input devices, and the monitor and printer are output devices. The hard disk is an input-output device because it can both input and output data.

Microcontroller

Microcontroller

The desktop computer you are using is a "general-purpose computer" that can run thousands of various programs. The microcontroller is a "dedicated computer" used for special purposes. It focuses on one thing. The microcontroller also has many common features. If a computer has most of the following characteristics, then you can call it a "microcontroller":

Microcontrollers are "embedded" in other devices to control the function and operation of the product. Therefore, the microcontroller is also called an "embedded controller". The microcontroller runs a specific program to complete a special task. This program is stored in ROM (Read Only Memory) and is generally not modified.

Microcontrollers are usually low-power devices. The power plug of a desktop computer is almost always plugged into a wall outlet, and its power is about 50 watts. The power of a battery-powered microcontroller is about 0.05 watts.

Microcontrollers have a dedicated input device, and usually (but not always) a light-emitting diode or LCD screen for output. The microcontroller also takes input signals from the devices it controls. It controls the device by sending signals to different parts of the device.

For example, a microcontroller in a television receives input signals from the remote control and displays them on the screen. The microcontroller will control the electronic adjustment of the channel selector, speakers, and some picture tubes. The engine controller in the car gets input signals from sensors such as oxygen and knock, and controls fuel mixing and spark plug timing. The microwave oven controller obtains the input signal from the operation keyboard, displays the output on the liquid crystal display, and controls the relay responsible for the microwave generator switch.

 

Block diagram of microcontroller

Block diagram of microcontroller

Microcontrollers are usually durable, but this is not always the case. For example, a microcontroller that controls a car's engine must be able to operate at a temperature limit that ordinary computers cannot withstand. The microcontroller of the car in Alaska, USA needs to work in the cold weather of minus 34 degrees Celsius, while the same controller needs to work in the hot environment of 49 degrees Celsius in Nevada. Coupled with the heat generated by the engine, the temperature of the engine box can be as high as 65-80 degrees Celsius.

The embedded microcontroller used inside the recorder does not have such requirements. There are many kinds of processors used as microcontrollers. For example, the Z-80 processor is an 8-bit microprocessor. It was born in the 1970s and was originally used in home computers at the time. The Garmin global positioning system in the working principle of the GPS receiver includes a low-power version of the Intel 80386 processor, which is said to be the case. The Intel 80386 processor was originally designed specifically for desktop computers.

In many products, such as microwave ovens, the performance requirements for microcontrollers are very low, and the price is the consumer’s main consideration. Under such circumstances, manufacturers began to design a dedicated microcontroller chip. It is an embedded central processor designed for low cost, small size, and low power consumption. Motorola 6811 and Intel 8051 are successful examples of such chips. There is also a series of controllers called "PIC microcontrollers" produced by Microchip. Judging by today's standards, these central processors are incredibly simple. However, the price for mass purchases is very low, and often only one piece can meet the needs of product designers.

 

Intel 8051 Pin Diagram

Intel 8051 Pin Diagram

A typical low-end microcontroller chip has about 1000 bytes of read-only memory and 20 bytes of random access memory, with 8 input and output pins. The unit cost of mass production of such chips is only a few cents. Of course, you can't expect to run programs like Microsoft Word on this chip because Microsoft Word requires about 30 megabytes of random access storage space and a processor that can execute millions of instructions per second. However, controlling a microwave oven does not require such a complicated program as Microsoft Word. What you want to accomplish with a microcontroller is a specific task. Low-cost and low-power operation is the most important.

Ⅱ Types of microcontroller

MCU is the abbreviation of the Microcontroller Unit. It is to appropriately reduce the frequency and specifications of the CPU. And interfaces such as memory, counter, USB, A/D conversion, UART, PLC, DMA, LCD driver circuits are integrated on a single chip to form a chip-level computer. The MCU can perform different combinations of control for different applications, such as mobile phones, PC peripherals, remote controllers, automotive electronics, industrial stepper motors, and robotic arms.

The MCU can be divided into without on-chip ROM type and with on-chip ROM type according to its memory type. For chips without on-chip ROM type, EPROM must be connected externally (typically 8031); chips with on-chip ROM type are divided into on-chip EPROM type (typical chip is 87C51) and MASK on-chip mask ROM type (typical The chip is 8051), on-chip Flash type (typical chip is 89C51) and other types.

Microcontrollers can be divided into the general type and special type according to the use. According to the width of the data bus and the length of data bytes that can be processed at one time, it can be divided into 8, 16, 32-bit MCU.

Ⅲ What is the difference between a microcontroller and a microprocessor?

The controller is a single-chip microcomputer that integrates the main part of the microcomputer on one chip. The microcontroller was born in the mid-1970s. After more than 20 years of development, its cost is getting lower and lower, and its performance is becoming more and more powerful. Examples include motor control, barcode readers/scanners, consumer electronics, gaming equipment, telephones, HVAC, building security and access control, industrial control and automation, and white goods (washing machines, microwave ovens).

 

Microcomputer system structure

Microcomputer system structure

1 The role of the microcontroller

In industrial applications, the role of the microcontroller is to control and coordinate the activities of the entire device. It usually requires a program counter (PC), an instruction register (IR), an instruction decoder (ID), a timing and control circuit, and a pulse source.

According to the role played by the controller in the work, the microcontroller mainly has the following types:

1) Instruction controller

The instruction controller is a very important part of the controller. It must complete the operations such as fetching instructions and analyzing instructions and then hand it over to the execution unit (ALU or FPU) for execution. At the same time, it also forms the address of the next instruction.

2) Timing controller

The role of the timing controller is to provide control signals for each instruction in chronological order. The timing controller includes a clock generator and a frequency doubling definition unit. The clock generator sends out a very stable pulse signal from the quartz crystal oscillator, which is the main frequency of the CPU. The multiplier definition unit defines how many times the CPU's main frequency is the memory frequency (bus frequency).

3) Bus controller

The bus controller is mainly used to control the internal and external buses of the CPU, including the address bus, data bus, control bus, and so on.

4) Interrupt controller

The interrupt controller is used to control various interrupt requests. It queues the interrupt request according to the priority and hands it to the CPU for processing.

2 The basic functions of the device controller

As far as the control field is concerned, there are mainly the following functions:

1) Data buffer

The buffer is often built into the controller. During output, the buffer is used to temporarily store the data from the host at high speed, and then transfer the data in the buffer to the I / O device at the rate that the I / O device has. At input, the buffer is used to temporarily store the data sent from the I / O device. After receiving a batch of data, the data in the buffer is transferred to the host at high speed.

2) Error control

The device controller is also responsible for error detection of the data transmitted by the I / O device. If an error occurs during transmission, the error detection code is usually set and reported to the CPU, so the CPU discards the data transmitted this time and performs another transmission. In this way, the accuracy of data input can be guaranteed.

3) Data exchange

This refers to data exchange between the CPU and the controller, and between the controller and the device. For the former, the CPU writes data to the controller in parallel or reads data from the controller in parallel via the data bus. For the latter, the device inputs data to the controller or transfers it from the controller to the device. For this, the data register must be set in the controller.

4) Identify and report equipment status

The controller will write down the status of the device for the CPU to understand. For example, the CPU can only start the controller to read data from the device when the device is in the ready-to-send state. To this end, a status register should be set in the controller, with each bit in it to reflect a certain state of the device. When the CPU reads the contents of this register, it can understand the status of the device.

5) Receive and recognize commands

The CPU can send a variety of different commands to the controller, and the device controller should be able to receive and recognize these commands. To this end, there should be corresponding control registers in the controller to store the received commands and parameters and to decode the received commands. For example, the disk controller can receive 15 different commands such as Read, Write, and Format from the CPU, and some commands also have parameters. Accordingly, there are multiple registers and command decoders in the disk controller.

6) Address recognition

Just like every unit in memory has an address, every device in the system also has an address. The device controller must be able to recognize the address of every device it controls. Also, for the CPU to write (or read) data to (or from) registers, these registers should all have unique addresses. For example, in the IB-MPC machine, the address of each register in the hard disk controller is one of 320 ~ 32F. The controller should be able to correctly recognize these addresses. For this purpose, an address decoder should be configured in the controller.

3 The difference between a microprocessor and a microcontroller

This difference is mainly concentrated in three aspects: hardware structure, application field, and instruction set characteristics:

1) Hardware structure

The microprocessor is a single-chip CPU, and the microcontroller integrates the CPU and other circuits in an integrated circuit chip to form a complete microcomputer system. In addition to the CPU, the microcontroller also includes RAM, ROM, a serial interface, a parallel interface, a timer and interrupt scheduling circuit. These are integrated into an integrated circuit. Although the on-chip RAM has a smaller capacity than ordinary microcomputer systems, this does not limit the use of microcontrollers. It can be learned later that the application range of the microcontroller is very wide.

An important feature of the microcontroller is the built-in interrupt system. As a control-oriented device, microcontrollers often have to respond to external stimuli (interruptions) in real-time. The microcontroller must perform a fast context switch, suspend one process to execute another process in response to an "event". For example, opening a microwave oven door is an event. In a microcontroller-based product, this event will trigger an interrupt. The microprocessor can also have a powerful interrupt function, but usually requires the cooperation of external components, and the microcontroller integrates all the necessary circuits to handle interrupts on the chip.

2) Application areas

Microprocessors are usually used as CPUs in microcomputer systems. Its design is precisely for such applications, which is also the advantage of the microprocessor. However, microcontrollers are often used for control-oriented applications. The system design pursues miniaturization and minimizes the number of components. In the past, these applications usually required dozens or even hundreds of digital integrated circuits. The use of a microcontroller can reduce the number of components used. Only a microcontroller, a small number of external components, and control programs stored in ROM can achieve the same function. Microcontrollers are suitable for those occasions where very few components are used to control input/output devices. Microprocessors are suitable for information processing in computer systems.

3) Instruction set features

Due to different applications, the instruction sets of microcontrollers and microprocessors are also different. The microprocessor's instruction set enhances processing capabilities, giving it a powerful addressing mode and instructions suitable for operating large-scale data. The instructions of the microprocessor can operate on nibbles, bytes, words, and even double words. By using address pointers and address offsets, the microprocessor provides an addressing mode that can access large amounts of data. Self-increasing and self-decreasing modes make it very easy to access data in bytes, words, or double words. Besides, the microprocessor has other features, such as the inability to use privileged instructions in user programs.

The instruction set of the microcontroller is suitable for input/output control. Many input/output interfaces are a single bit. For example, the electromagnet controls the switch of the motor, and the electromagnet is controlled by a 1-bit output port. The microcontroller has instructions for setting and clearing units, and can also perform other bit-oriented operations, such as logical AND, OR, and XOR operations on "bits". Few microprocessors have these powerful bit manipulation capabilities, because designers only consider operating data in bytes or larger units when designing microprocessors.

In terms of device control and monitoring (perhaps through a 1-bit interface), the microcontroller has dedicated internal circuits and instructions for input/output, timing, and priority assignment of external interrupts. Microprocessors generally need to cooperate with additional circuits (serial interface chip, interrupt controller, timer, etc.) to perform the same task. However, in terms of processing power alone, the microcontroller will never reach the level of a microprocessor because a large part of the integrated circuit in the microcontroller chip is used to implement other on-chip functions.

Due to the very limited resources on the microcontroller chip, the instructions must be very streamlined, and most instructions are shorter than 1 byte in length. The design principle of the control program is usually that the program can be loaded into the on-chip ROM. This is because even adding only one external ROM will significantly increase the hardware cost of the product. The basic feature of the microcontroller instruction set is a streamlined coding scheme. Microprocessors do not have such characteristics, because their powerful addressing mode makes the instruction coding not simple enough.


Processed in 1.487854 Second , 24 querys.