8-bit MCU (microcontroller) architecture features and design principles

Publisher:喜从中来Latest update time:2013-12-04 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Introduction

Since the emergence of microcontrollers in the 1970s, they have been rapidly developed and widely used in nearly 30 years. With the rapid development of microelectronics technology, microcontrollers have been widely used in household appliances, computing and peripherals, communications, industrial control, automated production, intelligent equipment, and instrumentation due to their outstanding advantages such as good performance, small size, favorable price, and complete functions, becoming the most effective tool for scientific research, teaching, and industrial technology transformation. From the simple microcontrollers that initially adopted the Princeton structure to the RISC microcontrollers that now generally adopt the Harvard bus structure, microcontrollers have achieved rapid development.

8-bit microcontrollers are the most widely used microcontrollers at present, and it is also the market that most companies are committed to cultivating. The market and price competition are extremely fierce, and the speed of introducing new products with various multi-functional requirements and different specifications is also very fast. With the rapid development of integrated circuit and semiconductor process technology, the continuous competition and integration of FPGA and SOC technology, the design of electronic products is gradually developing in the direction of better system performance, lower power consumption, lower cost, higher reliability, and easier development. Therefore, the rapid launch of 8-bit microcontroller chips or IP Cores with high cost performance, low power consumption, and high economic benefits that meet market demand has become a hot spot for many companies to compete.

2. Current updates and design trends of 8-bit microcontrollers

For different microcontroller (MCU) product applications, it is necessary not only to consider the cost performance of MCUs from different manufacturers, but also to consider the application characteristics of MCUs under different instruction systems. In response to the emergence of new intelligent electronic products, people have been developing new MCU products suitable for different embedded system applications. The instruction sets of MCU products from different manufacturers are different, especially the different instruction set system architectures. For example, the widely used MCS51 series and PIC series microcontrollers in the market use CISC instruction systems and RISC instruction systems respectively.

Microcontrollers can be divided into CISC, RISC, RISC-like and other types according to the instruction system. The traditional MCS51 controller belongs to the CISC type, which has high code density, but most instructions require multiple clock cycles to complete. The RISC type generally has a lower instruction density, but the instruction efficiency is very high. The RISC-like type has the advantages of both CISC and RISC. The reason why RISC and RISC-like have such high instruction efficiency is due to the hard wiring structure and pipeline structure brought by the small instruction set. Simple instruction sets can use hard wiring to decode instructions without the need for microcode control, which improves the efficiency of decoding. The pipeline structure divides instructions into several steps. When the pipeline is fully filled, the average execution time (CPI) of each instruction is about 1 clock cycle. Generally speaking, RISC is 50%-70% faster than the equivalent CISC, and is easier to design and debug.

Therefore, the current product development and research and design of 8-bit microcontrollers are mainly based on compatibility with products that have been widely adopted by customers in the market, and constantly improving performance and reducing power consumption to adapt to market competition and technological development. For microcontroller products that were originally CISC instruction systems, RISC ideas have gradually been integrated into the endless series of updates; for microcontrollers using RISC instruction systems, more practices are still to continuously optimize and improve their entire system architecture in response to the needs of high performance and low power consumption, especially the improvement of pipeline structure is the most common. This article is proposed under this situation, mainly discussing the design technology of 8-bit microcontroller products with RISC architecture.

3. Structural characteristics and design principles of RISC microprocessors

Although the industry still has different views on what features a RISC processor should have, various RISC structures have some common features: (1) Using the Harvard bus structure, most instructions are completed within one clock cycle to facilitate structural pipelining; (2) Using an independent and simple load/store structure; (3) Instruction decoding is usually hard-wired rather than micro-decoding to speed up execution; (4) Most instructions have a fixed format to simplify instruction encoding and decoding; (5) A small instruction set and a few addressing modes; (6) Data channel pipelines make the processing process highly parallel; (7) Use a large-capacity high-speed register stack (or register file) to avoid exchanging data with the lower-speed system RAM as much as possible. Try to store the operation data in the register to reduce the number of memory accesses. Based on the above discussion, the following article focuses on the key technologies in the design of 8-bit RISC microcontrollers from the perspective of architecture, high performance and low power consumption.

4. Key technologies

4.1 Selection of RISC instruction set

The use of the controller system is closely related to the specification interface between software programming and hardware design, which is the instruction set of the microcontroller. The instruction architecture (ISA) is the premise for the co-design of microprocessor hardware and software. The instruction set must be complete so that all computable functions can be implemented within a reasonable program space; and the instruction set must be efficient so that commonly used functions can be implemented with relatively few instructions. Therefore, the microcontroller system provided for application software development must have a complete and efficient instruction set.

The instruction set directly determines the internal hardware structure of the microcontroller, and is also the basis for the user program to compile and generate target code. The final determination of the instruction set is closely related to the program memory, data memory, register variables and memory addressing mode required by the entire system, and they are mutually restricted. Each component and even a specific byte should have a unique address so that the instruction set can correctly identify and operate each component or byte. Therefore, there are a series of different measures for different products: 1) Weigh the length of the instruction from the required address length and the corresponding increase in registers; 2) Classify the instructions and determine the instruction byte format of each type to simplify the decoding logic of the operation control signal; 3) Add corresponding registers to make up for the lack of instruction byte length; 4) The allocation of instruction byte format should take into account the structural complexity of the corresponding components and the corresponding addressing mode; 5) Whether the memory, register, and I/O port are uniformly addressed. The above list is not exhaustive and there is no order of precedence, and it should be analyzed at the same time. The corresponding measures have different performance, power consumption, and design complexity, and should be considered uniformly.

The power consumption analysis of ISA should be considered from two aspects: instruction code capacity and instruction execution efficiency. The selection of technologies such as instruction set size, register variables, memory addressing mode, and pipeline structure are closely related to instruction code density. Research has found that appropriately adding some specific complex instructions to the RISC reduced instruction set is a feasible way to improve code density and ensure processor high performance and low power consumption. Therefore, the instruction set that can generate high instruction code density is undoubtedly the first choice for RISC low-power design.

4.2 Paging Design of Register File with Shared Area

The most important feature of RISC design concept is that all operations are register-oriented. Using register-register operation instructions to transfer data speeds up the process, simplifies the instruction control logic, and reduces the chip area of ​​the control components composed of hard-wired logic. [page]

The number of bits of the fixed register address in the instruction will inevitably limit the number of registers, but the introduction of the segmentation and paging design ideas of high-end processors can expand the addressing range. The fundamental starting point of the segmentation and paging design ideas is to decompose the linear address of the memory into two-dimensional or multi-dimensional addresses; only the lowest-dimensional address is expressed in the instruction, and other facilities (such as segment number registers and page number registers) are used to store high-dimensional addresses. Generally, the register stack is divided into several pages, each page has a fixed size, and only the page address of the register is used in the instruction. Set a page number register in the system-specific register, and switch access to registers of different pages by changing its content.

In order to overcome the various defects of the simple paging mechanism, a paging design with a shared area is usually adopted, which not only reduces the number of bits of the register logical address in the instruction, but also allows access to the system register at any time, and facilitates the exchange of information between registers on different pages through the general registers in the shared area. Of course, there must also be corresponding methods and measures for mapping logical addresses to physical addresses.

4.3 Paging Design of Program Space

For the same reason as the register stack, if the complete program space address is used in the instruction, the size of the program space will be limited, so the program space is usually designed with a paging concept, and a common program area is set up in different pages (if the instruction length fully meets the requirements of the program space address, this concept is not necessary). The design concept is similar to the register paging design with a shared area, so I will not go into details here. The only difference from the register common area is that the program common area provides a platform for the program to jump between different pages.

4.4 Pipeline Technology

Pipeline design is closely related to the 8-bit RISC microcontroller architecture and is the design core of the entire system. Its selection directly affects the performance and power consumption of the system.

Pipeline technology can maximize the use of microcontroller resources, so that each component works in each clock cycle, greatly improving efficiency. However, there is a strong dependency between the various segments of the pipeline. If handled improperly, the execution of instructions will not achieve the expected results, so it is necessary to be familiar with the correlation and transfer issues of the pipeline. The first is resource conflict, that is, competing for the same functional component at the same time, generally accessing the memory at the same time, which requires pausing one beat of the pipeline; the second is data correlation conflict, which has three types: RAW, WAR, WAW. To solve this conflict, use the internal direct structure or delay the pipeline by one beat; the third is control transfer conflict, that is, for conditional jump instructions, whether to jump can be determined based on the calculation result to determine the new PC value. The calculation result is obtained after the execution stage, which makes the pipeline lose a lot of performance. Generally, the conflict is solved by adding hardware to obtain the calculation result in advance.

The longer the pipeline, the more serious the two major problems of correlation and transfer: on the one hand, the complexity of the hardware control circuit is greatly increased, and on the other hand, the pause of the pipeline beat leads to an increase in the CPI value and a decrease in system performance. Therefore, the longer the pipeline is, the better it is. Finding a balance between speed and efficiency is the most important thing.

There are many schemes in the pipeline design of 8-bit RISC microcontrollers. Different schemes correspond to different areas, speeds and power consumption. The specific selection should be considered from multiple aspects. First, a variety of specific pipeline structure schemes and their required strict timing should be derived from the system's operating rate requirements and the number and depth of pipelines; then, the advantages and disadvantages of each scheme should be judged from the aspects of system power consumption, area, performance and design complexity caused by pipeline-related and transfer problems; finally, the optimal scheme should be selected by compromise.

4.5 Low Power Consumption Technology

With the rapid development of the semiconductor industry, integrated circuits have entered the deep submicron stage, the clock frequency and chip integration of microprocessors have continued to increase, and power consumption has become a primary concern in many design fields, especially high-performance microprocessors and portable electronic equipment products.

When co-designing the hardware and software and determining the instruction architecture according to the system function description, the design power consumption results caused by different design starting points will be very different. Therefore, the determination of the entire system architecture is undoubtedly the primary issue that should be considered for low power consumption, which mainly reflects the following aspects: 1) Optimize the instruction set according to functional requirements as much as possible and simplify the decoding unit and execution unit of the system; 2) Realize the low power structure by developing the parallelism of hardware and the pipeline execution of functional units; 3) Reasonably set and determine the capacity of memory and registers to reduce the number of required buses; 4) The division of each sub-module of the system hardware and the setting of different working states in the software are very important for optimizing power consumption.

5. Conclusion

Today, as the application of microcontrollers becomes increasingly widespread, higher requirements are placed on microcontrollers, hoping for faster speed, lower power consumption, low price, easy to learn and use, and fewer peripheral devices when composing the system. Therefore, the product development and design research of the 8-bit microcontroller, which is currently the most widely used, is particularly important. Because its architecture design is the key to the entire design, all subsequent work depends on the designed architecture. This article analyzes and discusses the issues that should be considered in the key technologies used in the 8-bit RISC architecture, which has certain research value and significance.

Reference address:8-bit MCU (microcontroller) architecture features and design principles

Previous article:Knowledge of microcontroller interrupts
Next article:Design of thyristor trigger device based on single chip microcomputer

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号