Microcontroller (MCU) architecture analysis

Publisher:码字奇才Latest update time:2018-04-05 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    Microcontrollers (MICroController) can be referred to as MCU or μC, and some people call it single chip microcontrollers (Single Chip Microcontroller). It combines ROM, RAM, CPU, and I/O in the same chip to perform different combination controls for different applications. Microcontrollers have been continuously researched and developed in recent years, from 4-bit, 8-bit, to the current 16-bit, 32-bit, and even 64-bit. The maturity of the product, the number of manufacturers involved, and the wide range of applications are unprecedented. At present, foreign manufacturers are leading in technology because of their early development and wide product lines, while local manufacturers win by taking multi-functional products as the orientation. But it cannot be denied that the price war of local manufacturers is the key factor that threatens foreign companies.


    Due to the improvement of manufacturing process, the price difference between 8-bit MCU and 4-bit MCU is almost the same, and 8-bit has gradually become the mainstream in the market; for 4-bit MCU, most suppliers adopt order-based production. At present, 4-bit MCU is mostly used in calculators, car meters, car anti-theft devices, pagers, wireless phones, CD Players, LCD driver controllers, LCD Games, children's toys, scales, chargers, tire pressure gauges, thermometers and hygrometers, remote controls and point-and-shoot cameras, etc.; 8-bit MCU is mostly used in electric meters, motor controllers, electric toy machines, variable frequency air conditioners, pagers, fax machines, caller ID, telephone recorders, CRT Display, keyboard and USB, etc.; 16-bit MCUs are mostly used in mobile phones, digital cameras and camcorders, etc.; 32-bit MCUs are mostly used in Modem, GPS, PDA, HPC, STB, Hub, Bridge, Router, workstation, ISDN phone, laser printer and color fax machine; 64-bit MCUs are mostly used in high-end workstations, multimedia interactive systems, advanced video game consoles (such as SEGA's Dreamcast and Nintendo's GameBoy) and advanced terminals, etc.

    In terms of MCU development, there are two main streams in terms of architecture: RISC (such as HOLTEK HT48XXX series) and CISC (such as Winbond W78 series). RISC (Reduced Instruction Set Computer) means that all instructions of MCU are composed of some simple instructions. Simple instructions mean that the circuit of MCU can be optimized as much as possible, thereby increasing the execution speed and reducing the time required for one instruction to the shortest. HOLTEK's HT46XX (A/D MCU series), HT47XX (R to F MCU series), HT48XX (general I/O MCU series) and HT49XX (LCD MCU series) are designed with RISC structure. Whether it is RISC or CISC (Complex Instruction Set Computer), the purpose of designing MCU is to serve mankind. For RISC, due to the simplicity of the instruction set, many tasks must be combined with simple instructions, and more complex combinations of tasks need to be performed by a "compiler". CISC MCU has more instruction sets provided by the hardware, so many tasks can be replaced by one or several instructions, and the compiler's work is therefore reduced a lot.

     Figure 1: MCU architecture block diagram.

    Program Memory

    Program ROM is a read-only and non-writable memory unit in a microcontroller. This memory is mainly used to store programs developed by users, and its nature is data that is not often changed or never changed. The operation of the microcontroller is based on the program instructions stored in this area. The common program memory capacities in 8-bit single chips are 0.5K, 1K, 2K, 4K and 8K, and the program memory commonly used in microcontrollers has the following types, see (Table 1):

345

 Table 1: Program memory in a microcontroller is usually organized in several ways.

    In addition, regarding the program confidentiality, whether it is encryption or fuse protection, it is to prevent the program from being peeped or stolen by unauthorized users (such as decompiling the program, modifying the content, stealing the program, etc.). The program confidentiality function option is only used on OTP, window packaging, EEPROM and  FLASH ROM  , because these ICs can read the program code back and forth through the burner, and the Mask version does not require the program confidentiality step. Random Access Memory Random Access Memory ( RAM), also known as Read/Write Memory, is often used to temporarily store data or store data during program execution. It has a wide range of uses. Taking the HOLTEK 8-bit microcontroller as an example, its capacity has 64, 96, 160 and 224 Byte options.

    Accumulator

    The accumulator is the core of the MCU. 80% of the instructions are related to the accumulator. Data can be stored in the accumulator until the bus or other units are ready to accept it, or until the program needs it.

    Cache

    Registers are places inside the MCU that temporarily store data. The functions of each register are different, but they all have a common feature, which is that they can be directly read/written. Because they are located inside the MCU, some unnecessary waiting and addressing time are reduced. In addition, some MCU I/O ports are also directly accessed and controlled in the form of registers.

    Stack and stack pointer

    Stack and Stack Pointer. Stack is like a plate, stacked from bottom to top one by one, and when taking out, take it out from the top one by one, and cannot be taken out from the middle, so it is also called "Last-In-First-Out Queues". The functions are as follows;

    1. Temporarily store the value of PC (Program Count), which is suitable for "subroutine call" or temporarily storing the value of PC when an interrupt occurs;

    2. It can be used as a buffer and completed by Push and Pop;

    3. Some MCUs have fixed number of stack levels (such as HOLTEK μC series), while others can be customized.

    The function of the Arithmetic Logic Unit (ALU) is to execute arithmetic instructions and logical judgments. In addition to generating results, it also generates related flags (Zero, Carry, Borrow, Status). Each MCU is different, especially the Carry Flag, which must be checked in the instruction explanation table.

    Input/Output (I/O Port)

    In single-chip microcomputer application systems, I/O expansion is not the purpose, but to provide an input/output channel for external devices as a communication channel between the outside world and the MCU. For example, connecting a keyboard, display, drive switch control or measurement, etc. When expanding I/O, the hardware circuit characteristics of the peripheral devices connected to it must be considered, such as: potential matching, interference suppression, driving ability (such as Source, Sink ability), etc.

    Microcontrollers have a variety of circuit forms for I/O ports, many of which can set the input/output direction in bit units through software. Each port is equipped with a high- current , high-voltage buffer to directly drive  LEDs  and high-power transistors , as well as for analog signal input.

    Timer, timer

    Timer (Time Counter), timer (Timer), by adding an external oscillator crystal, through the frequency division circuit to provide MCU with several different time bases (Time Base). Commonly used in:

    1. Clock time base (such as 1sec, 500ms, 62.5ms, 15.625ms, etc.);

    二. PWM(Pulse Width Modulation)之 Time Base;


    3. Key SCAN;

    4. LED Scan;

    五. Frequency output;

    六. Pulse Reading;

    7. APO (Auto Power OFF), etc. Counter


    Event Counter is used to accumulate the number of external events, which may be pulse or other data, and can also be used to generate correct time delay. Commonly used in:

    1. Another time base with a fixed frequency; 2. Counter; 3. Can be programmed as another immediate interrupt input;

    4. Speed ​​Meter, Tachometer. Interrupts Interrupts are used to handle immediate events or events that are prioritized for processing. They are responsible for time counter timeout interrupts and interrupt requests generated by external events. Most microcontrollers have multi-layer interrupt processing systems with built-in interrupt priority circuits to determine the order of priority. Commonly used in:

    1. The MCU is in passive Standby state (Halt-Stop) and wakes up by an external signal;

    2. Need to be processed immediately ( sensors , switches, alarms, power failure alarms); 3. Need to be processed at a fixed interval (Display, Key Scan, Read-Time C LOC k); Peripheral resources on the microcontroller

    After looking at the basic architecture of so many microcontrollers, let us continue to understand what peripheral resources can be added to the microcontroller to expand and extend its functions.

    Serial I/O

    Microcontrollers contain serial I/O to provide communication channels with external peripheral Dev ICs . There are different types for each manufacturer, and the common ones are as follows:

    ◆UART(Universal Asynchronous Receiver Transmitter):Intel,Atmel;

    ◆USART(Universal Synchronous/Asynchronous Receiver Transmitter ):Siemens;

    ◆SPI(Serial Peripheral Interface):Motorola;

    ◆SCI (Sertal Communications Interface): This is an enhanced version of UART;

    ◆I2C bus (internal Integrated Circuit bus): Philips;

    ◆Microwire/Plus:National SEMIconductor;

LCD     Driver ​

    LCD (Liquid Crystal Display) is a commonly used display device in display interfaces. For example, it can be found in some multi-function phones, digital thermometers, pagers, mobile phones, and handheld game consoles. Therefore, microcontrollers with built-in LCD driver circuits are widely used. There are two driving modes to choose from: Segment and Dot Matrix. For example, the popular pet eggs use Dot Matrix LCD displays. Japanese microcontroller manufacturers provide a variety of microcontrollers with built-in LCD driver devices for selection. In addition, the HO LTE K HT49XX series also provides microcontrollers with LCD driver devices.

    Fluorescent Tube Driver (VFT Driver)

    We cannot read the contents of LCD displays without light or backlight, but VFT displays can provide high brightness and multi-color visual effects, and are often used in advanced home appliances, such as DVD players and DSP  equalizers. For products that require dazzling output effects, VFT (Vacuum Fluorescent Tube) Driver is one of the important resources in the selection of microcontrollers.

    OSD is one of the indispensable functions for the humanized interface of TV and monitor. The display circuit of OSD (On Screen Display) receives the horizontal synchronization signal (H-Sync) and the vertical synchronization signal (V-Sync), and then sends the screen information through RGB and Blanking. The display color can reach up to eight. The execution rate of each microcontroller instruction will cause the number of lines and fields of OSD to be different. The number of lines displayed ranges from two to dozens of lines, and the field ranges from 15 to 26 characters or more. Usually, the faster the execution rate, the more lines and fields can be displayed, and the slower the rate, the more direct display will be limited.

    Analog to digital converter (ADC)

    Since many applications of microcontrollers require the detection of external environmental conditions as a reference for processing data, for example, in TV applications, the automatic frequency control (AFC) signal of the tuner is a voltage signal. Other detections such as temperature are also mostly converted into voltage signals. Therefore, the application of analog to digital converters is very extensive in industrial and consumer electronics.

    Analog applications are so frequent that manufacturers provide analog/digital conversion as a general standard specification (such as HOLTEK HT46XX series). However, the resolution of analog/digital varies greatly from manufacturer to manufacturer, ranging from 3 to 10 bits, depending on different needs. Although there are many conversion channels, usually only one circuit is used for processing, which is switched by a selector. For applications where time consideration is not particularly emphasized, it will not have much impact.

    There is another analog/digital conversion method, which is R to F (Resistance to Frequency), which is generally used in temperature/humidity detection. It uses the change characteristics of the resistance / capacitance sensor to convert it into a frequency value, and uses this frequency value to calculate the relativity of temperature/humidity. Such ICs include the HOLTEK HT47XX series.

    Digital to Analog Converter ( DAC )

    When controlling analog components, analog signals are required. For microcontrollers, digital to analog converters must be built in to cope with this. The internal structure is composed of digital to analog converter registers and a ladder resistor, and the digital/analog resolution is 8 bits each. In an 8-bit microcontroller with a reference voltage of 5V, assuming that a digital value of 60 is converted into an analog value, the calculation method is (60/256x5Volts) = 1.171875V. For example, in a phase-locked loop, the VCO (voltage-controlled oscillator ) can be controlled by DAC. In addition, Voice IC also uses the original voice recording into digital data, and then uses DAC to convert the digital data audio to restore the analog voice signal. The purpose of pulse width modulation ( PWM ) is also to achieve an analog effect by matching digital output with peripheral circuits. Its components include pre-divider, counter, data latch, and compare circuits. PWM (Pulse Width Modulation) resolution is controlled by the program. Of course, the time and duty cycle calculation techniques can also be used to achieve the PWM function in general I/O ports, but the response speed will be limited. In addition, major semiconductor manufacturers today all provide microcontrollers with PWM functions for convenience (such as the HOLTEK HT46XX series). There is really no need to focus on PWM programming to reduce the burden on software. The PWM function has a resolution of 6 to 14 bits, which is suitable for various needs.

    DTMF generator and receiver The telephone has evolved from the original pulse to the current tone decoding method, which not only improves the decoding speed, but also increases reliability and noise resistance . DTMF (Dual Tone Multiple Frequency) is a mixed audio signal of two frequencies, so decoding is less likely to go wrong. When applied to microcontrollers for telephone products, the DTMF resource is often an important specification to select.

    Watchdog Timer Microcontrollers are not allowed to crash in products, but due to noise interference or improper operation, preventive measures must be taken to ensure that the microcontroller can automatically reset in the event of a crash so that the microcontroller can continue to operate. We can say that the watchdog timer is a timer that automatically resets the microcontroller when it crashes.

    Watchdog timer is used to monitor whether the microcontroller has abnormally crashed. Many microcontrollers have it as a standard feature.

    The watchdog timer is actually like a self-running RC oscillator. It does not require any external parts. That is to say, no matter whether the clock oscillation of the chip's clock oscillation pin stops or not, it will continue to count without interruption, even if the chip enters the power-saving Halt state (in the Halt state, the chip's clock stops oscillating but the Watchdog timer will not stop timing. When the timing expires, the chip will automatically reset, and the I/O pin output remains unchanged, which saves power). Whether to enable the Watchdog timer must be decided when the program is burned in the OTP version in order to decide whether to blow its fuse. In the Mask version, the user can choose whether to use this function.

    The higher the supply clock of a dual-clock microcontroller, the greater the power consumption. Therefore, when selecting products that use battery power, dual-clock is often a function that must be considered. Generally, the secondary clock operates at 32.768K Hz  and is mainly used for timing (RealTime Clock).

    Therefore, based on the above, the instruction set structure of the microcontroller is relatively simple, easy to develop and modify, and has strong I/O and interrupt processing capabilities. The main development work is concentrated on software design. As long as the development system (ICE: In-Circuit Emulator) and the universal board are used, online simulation work can be carried out to carry out design and modification work. Since the microcontroller has low unit price, simple system hardware architecture, easy development and modification of application programs, good chip stability, and high reliability, its application field is extremely wide and almost ubiquitous. Therefore, choosing different equipment in different occasions and fully understanding the internal resources of the microcontroller will help product development and reduce costs. It is believed that new peripheral resources will be added to the microcontroller in the future, and the scope of application will become wider and wider. It has also replaced the traditional circuit design concept and become the new design mainstream.


Reference address:Microcontroller (MCU) architecture analysis

Previous article:A multifunctional charging system based on single chip microcomputer control that can charge various types of batteries
Next article:Design of signal generator based on AT89C52 single chip microcomputer and DAC0832 D/A converter chip

Recommended ReadingLatest update time:2024-11-16 16:21

A DSP Program Optimization Method for XC166 Single-Chip Microcomputer Independent of Hardware Technology
The instruction pipeline of XC166 microcontroller has inevitable blocking phenomenon, and the same is true for MAC unit instructions. Although dedicated modules have been used to reduce blocking during hardware design, some blocking is inevitable. From the perspective of program optimization, the blocking phen
[Microcontroller]
A DSP Program Optimization Method for XC166 Single-Chip Microcomputer Independent of Hardware Technology
Design of infrared remote control system for lamp head based on single chip microcomputer
  1 Principle of infrared remote control system   The structural forms of infrared remote control circuits are generally divided into three types, namely: single-channel remote control switch circuit, single-channel step-by-step remote control circuit and multi-channel remote control circuit. This design uses a sing
[Microcontroller]
Design of infrared remote control system for lamp head based on single chip microcomputer
Will single chip opportunities be eliminated? Are microcontrollers still useful today?
I often read some questions on the Internet about whether PLC will be replaced by MCU, and whether MCU will be replaced by PLC. If the technology you have worked so hard to learn becomes obsolete by then, it will be a big trap. I have been engaged in development work in the microcontroller industry for 10 years. What
[Microcontroller]
Single chip C language to achieve independent key detection and matrix keyboard operation
Almost all electronic products involve key operation. So how does the microcontroller recognize whether a key is pressed, how does it react after it is pressed, and how to prevent key jitter? Going deeper, how does the microcontroller recognize the matrix keyboard? This article will explain in detail how to use C lang
[Microcontroller]
AT89C52 MCU pin description, AT89C52 high performance 8-bit MCU
AT89C52 MCU pin description, AT89C52 high performance 8-bit MCU AT89C52 Pin DiagramAT89C52 is a low voltage, high performance CMOS 8-bit single chip microcomputer, with 8k bytes of repeatedly erasable Flash read-only program memory and 256 bytes of random access data memory (RAM). The device is pro
[Analog Electronics]
AT89C52 MCU pin description, AT89C52 high performance 8-bit MCU
Analysis on the selection of components for PIC microcontroller human-machine interface module
PIC microcontroller human-machine interface module component selection instructions: (1) Chip pins. 12 to 20 are bidirectional independently programmable I/O ports of PIC16C5X. Each I/O port can be programmed to determine its input/output direction. There are 5 types of PIC16C5X, as shown
[Microcontroller]
Analysis on the selection of components for PIC microcontroller human-machine interface module
Using advanced MCU technology to achieve high-efficiency motor control
        Motors contribute nearly 50% of energy consumption in the United States, so reducing motor energy consumption can effectively improve energy efficiency, and using advanced microcontroller (MCU) technology to implement motor control is an effective way. This article introduces the latest developments in motor co
[Microcontroller]
Using advanced MCU technology to achieve high-efficiency motor control
Over 10 million units: BYD Semiconductor's automotive-grade MCUs demonstrate strong strength again
MCU, the microcontroller unit, is the core of the internal calculation and processing of the automotive electronic system and is the key to realizing the intelligentization of automobiles. BYD Semiconductor has been deeply involved in the MCU field for more than ten years and has a series of automotive-grade and indus
[Automotive Electronics]
Over 10 million units: BYD Semiconductor's automotive-grade MCUs demonstrate strong strength again
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号