Thread Tools
This thread is privately moderated by eddy2019, who may elect to delete unwanted replies.
Jul 29, 2019, 07:22 AM
Registered User
Thread OP

What is the role of the microcontroller and the difference with microprocessor

A microcontroller is a single-chip microcomputer that integrates the main part of a microcomputer on a single chip. Microcontrollers were born in the mid-1970s. After more than 20 years of development, their cost is getting lower and lower, and their performance is getting stronger and stronger, which makes their applications ubiquitous in all fields. Examples include motor control, bar code readers/scanners, consumer electronics, gaming equipment, telephones, HVAC, building security and access control, industrial control and automation, and white goods (washing machines, microwave ovens).

The role of the microcontroller
In industrial applications, the role of the microcontroller is to control and coordinate the actions of the entire device, usually requiring a program counter (PC), an instruction register (IR), an instruction decoder (ID), timing and control circuitry, and a pulse source. Interrupts, etc. are completed together.

According to the role played by the controller in the work, the main types of microcontrollers are as follows:

1, command controller

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

2, timing controller

The purpose 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 multiplication defining unit, wherein the clock generator sends a very stable pulse signal from the quartz crystal oscillator, which is the main frequency of the CPU; and the frequency multiplication defining unit defines the CPU frequency as the memory frequency ( Several times the bus frequency).

3, bus controller

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

4, interrupt controller

The interrupt controller is used to control various interrupt requests, and queue interrupt requests according to the priority level, and hand them to the CPU for processing. Basic functions of the controller Basic functions of the device controller

At present, for the control field, there are mainly the following functions:

1, data buffering

Buffers are often built into the controller. At the time of output, the buffer is often used to temporarily store data transmitted by the host at high speed, and then transfer the data in the buffer to the I/O device at the rate of the I/O device. At the time of 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 also handles error detection of 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 invalidates the data transmitted this time and retransmits it. This will ensure the correctness of the data input.

3. Data exchange

This refers to the exchange of data between the CPU and the controller and between the controller and the device. For the former, data is written to the controller in parallel by the CPU through the data bus, or data is read out in parallel from the controller; for the latter, the device inputs data to the controller or from the controller to the device. . To do this, the data register must be set in the controller.

4. Identify and report the status of the device

The controller should note the status of the device for the CPU to understand. For example, the CPU can start the controller to read data from the device only when the device is in the ready state. To this end, a status register should be set in the controller, with each of them reflecting a certain state of the device. When the CPU reads in the contents of the register, you can know the status of the device.

5, receiving and identifying 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 a corresponding control register 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 sent by the CPU, and some commands also have parameters; accordingly, there are multiple registers and command decoders in the disk controller.

6, address recognition

Just as every cell in memory has an address, every device in the system also has an address, and the device controller must be able to identify the address of each device it controls. In addition, in order for the CPU to write (or read) data to (or from) registers, these registers should have unique addresses. For example, in the IB-MPC machine, the address of each register in the hard disk controller is one of 320 to 32F. The controller should be able to correctly identify these addresses, for which purpose the address decoder should be configured in the controller.

The difference between microprocessor and microcontroller
This difference mainly focuses on three aspects: hardware structure, application domain and instruction set features:

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. The complete structure of most microcontrollers is shown in the dashed box in Figure 1-6. In addition to the CPU, the microcontroller also includes RAM, ROM, a serial interface, a parallel interface, timers and interrupt scheduling circuitry. These are all integrated on an integrated circuit. Although the capacity of the on-chip RAM is smaller than that of a conventional microcomputer system, this does not limit the use of the microcontroller. As you will see later, microcontrollers are used in a wide range of applications.

An important feature of microcontrollers is the built-in interrupt system. As a control-oriented device, the microcontroller often responds to external excitations (interruptions) in real time. The microcontroller must perform a fast context switch, suspending one process to execute another process in response to an "event". For example, opening a door to a microwave oven is an event that will trigger an interrupt in a microcontroller-based product. Microprocessors also have powerful interrupt functions, but usually require the cooperation of external components, and the microcontroller integrates all the circuitry necessary to handle the interrupts on-chip.

2) Application field

Microprocessors are often used as CPUs in microcomputer systems. Its design is aimed at such an application, 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 typically required tens or even hundreds of digital integrated circuits. The use of a microcontroller can reduce the number of components used, and a single microcontroller, a small number of external components, and a control program stored in the ROM can achieve the same function. Microcontrollers are suitable for applications where input/output devices are controlled with very few components, while microprocessors are suitable for use in computer systems for information processing.

3) Instruction set features

The instruction set for microcontrollers and microprocessors varies from application to application. The microprocessor's instruction set enhances processing power, giving it a powerful addressing mode and instructions for manipulating large-scale data. Microprocessor instructions can operate on nibbles, bytes, words, or even double words. By using address pointers and address offsets, the microprocessor provides an addressing mode that can access large amounts of data. The auto increment and decrement modes make it very easy to access data in bytes, words or double words. In addition, the microprocessor has other features, such as the inability to use privileged instructions in the user program.

The microcontroller's instruction set is suitable for input/output control. Many input/output interfaces are single/bit. For example, an 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 perform other bit-oriented operations, such as logical AND, or XOR operations on "bits", jumps based on flag bits, and so on. Few microprocessors have these powerful bit manipulation capabilities because designers only consider operating data in bytes or larger when designing a microprocessor.

In terms of control and monitoring of the device (possibly via a 1-bit interface), the microcontroller has dedicated internal circuitry and instructions for priority assignment of input/output, timing and external interrupts. Microprocessors generally need to work with additional circuitry (serial interface chip, interrupt controller, timer, etc.) to perform the same task. However, in terms of processing power alone, the microcontroller never reaches the level of the microprocessor (all other things being equal) because a large part of the integrated circuit in the microcontroller chip is used to implement other on-chip The cost of the function is to sacrifice some processing power.

Due to the tight resources on the microcontroller chip, its instructions must be very streamlined, and most instructions are shorter than 1 byte in length. The design principle of the control program is usually to require the program to be loaded into the on-chip ROM, 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 that it has a streamlined coding scheme. Microprocessors do not have such features because their powerful addressing modes make instruction encoding less concise.
Sign up now
to remove ads between posts

Quick Reply
Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Measuring Thrust with Motor/Prop On or Off the Plane. What's the Difference? BSquared18 Power Systems 72 May 23, 2019 10:32 AM
Discussion What is the role of the Police? DR. JOY Life, The Universe, and Politics 6 Apr 28, 2019 07:33 PM
Discussion What car to buy - but with a difference ChrisE Off-road Cars 12 Apr 16, 2017 01:02 PM
Question What happens with Pixhawk Mission Planner in different scenarios? samir_munir Beginner Multirotor Drones 2 Feb 03, 2017 07:30 AM
Discussion Recommended ESC's to use with my own microcontroller regnar86 Multirotor Drone Electronics 1 Nov 25, 2016 10:39 PM