In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
In embedded development, there are two kinds of processors: microcontroller and microprocessor. So what's the difference between the two processors? Microcontroller = CPU + on-chip memory + chip peripherals; microprocessor = CPU. In the past, when there were few embedded hardware resources, the difference between them was very big for hardware engineers. But in modern embedded systems, their concepts are almost the same. Relatively speaking, microcontroller has the advantages of low cost and low power consumption, so it is often used in embedded system design. For software engineers, there is no difference between microcontroller and microprocessor.
The content of this series of blog is based on the summary of the main courses in the Disciplinary Program of Ditai Software Institute, Ditai Technical Exchange Group: 199546072.
Let's take a look at the classification of registers: CPU registers and peripheral registers. CPU register refers to special instruction execution, data operation, variable processing and parameter transfer; peripheral register is used to control the behavior and working mode of the peripheral, and the register is worth configuring according to the chip manual. Key registers in the processor: PC-reset counter (instruction pointer IP) and SP-stack pointer (Stack Pointer). The characteristic of PC program counter, each time an instruction is executed, the value in PC will change, and the PC clock stores the address of the next instruction to be executed by CPU. The characteristics of the SP stack pointer always point to the top of the stack space, realize the LIFO feature, and save break points, function call return points and CPU field data. Let's look at the use cases of PC and SP: function calls. As follows
When the function is called, PC points to the address of the jump function. After it executes the contents of the jump function, it then returns to the previous function and executes the code. So how does it know where to go back? The SP stack pointer is used at this point. The context information at this time is saved to the stack pointed to by the SP stack pointer before the PC jumps. When you want to return the address of the original function after executing the contents of the jump function, the SP stack pointer is used to return it. The bp pointer is used to hold the base address of the SP stack pointer, and when the context information of the PC is saved, the SP will move downward.
Let's take a look at the IO operation of the processor. The data communication between the processor and the peripheral is completed through the IO operation. IO is divided into memory-mapped IO space and independent IO space. Memory-mapped IO space means that peripherals are mapped to the address space of processors through precise hardware connections, and communicate with peripherals through address access, while independent IO space refers to independent address space, which can not access peripherals through addresses, and uses special instructions to communicate with peripherals. From the software engineer's point of view, you only need to read and write different IO ports to operate peripherals; read and write IO ports when the specific value and meaning need to consult the specific hardware manual. So what is the key to hardware design? As follows
Through the specific hardware design, when the value on the address bus is in a certain range, the chip selection signal is "true", that is, the device that enables the connection, thus reading the data in the corresponding address! These are all things that hardware engineers care about, and we only need to be able to read and understand them. Let's take the address mapping of a specific device as an example, the address is 0xFFFF1234, as follows
We see that the lower 16 bits are connected to the door, that is, they can only be connected if they are all 1. Next, let's take a look at the processor boot process: 1, after the processor is powered on, the PC register solidifies a default value; 2, the PC default value is used to determine the first execution instruction; 3, the first execution assignment belongs to the boot sequence. As shown in the following figure
In the embedded startup program, we call it BootLoader, which is also the first program (Not OS) to run after the system is powered on. According to the running stage, the volume and function are divided into three parts: a > BL0-solidified in the hardware, used to initialize the hardware, load and run BL1;b > BL1-stored in the external storage device, used to initialize the main memory, load and run BL2;c > BL2-stored in the external storage device, used to guide the operating system to execute.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.