The execution of each instruction by the computer can be divided into three stages. That is, fetching instructions, analyzing instructions
, and executing instructions. The task of fetching instructions is to read the current instruction from the program memory according to the value in the program counter PC and send it to the instruction register.
The task of analyzing instructions is to take out the instruction opcode in the instruction register, decode it, and analyze its instruction properties. If the instruction requires an operand, then find the operand address.
Keywords:MCU
Reference address:MCU execution program process
, and executing instructions. The task of fetching instructions is to read the current instruction from the program memory according to the value in the program counter PC and send it to the instruction register.
The task of analyzing instructions is to take out the instruction opcode in the instruction register, decode it, and analyze its instruction properties. If the instruction requires an operand, then find the operand address.
The process of computer execution of program is actually to repeat the above operation process one by one until the stop instruction is encountered and the instruction can be looped and waited for.
When a general computer is working, the program and data must first be sent to the memory through the input interface circuit and the data bus through the external device, and then taken out and executed one by one. However, the program in the single-chip microcomputer is generally solidified in the on-chip or off-chip program memory through the writer in advance. Therefore, the instruction can be executed as soon as the computer is turned on.
Below we will give an example to illustrate the execution process of the instruction:
when the computer is turned on, the program counter PC changes to 0000H. Then the single-chip microcomputer automatically enters the execution process of the program under the action of the timing circuit. The execution process is actually a cycle of taking out instructions (taking out the instructions stored in the memory in advance) and executing instructions (analyzing and executing instructions).
For example, the execution instruction: MOV A, #0E0H, its machine code is "74H E0H", the function of this instruction is to send the operand E0H to the accumulator,
74H is stored in the 0000H unit, and E0H is stored in the 0001H unit. When the microcontroller starts running, it first enters the instruction fetch stage, and the order is:
1 The content of the program counter (0000H at this time) is sent to the address register;
2 The content of the program counter is automatically increased by 1 (becomes 0001H);
3 The content of the address register (0000H) is sent to the memory through the internal address bus, and the address decoding circuit in the memory selects the unit with address 0000H;
4 The CPU makes the read control line valid
When a general computer is working, the program and data must first be sent to the memory through the input interface circuit and the data bus through the external device, and then taken out and executed one by one. However, the program in the single-chip microcomputer is generally solidified in the on-chip or off-chip program memory through the writer in advance. Therefore, the instruction can be executed as soon as the computer is turned on.
Below we will give an example to illustrate the execution process of the instruction:
when the computer is turned on, the program counter PC changes to 0000H. Then the single-chip microcomputer automatically enters the execution process of the program under the action of the timing circuit. The execution process is actually a cycle of taking out instructions (taking out the instructions stored in the memory in advance) and executing instructions (analyzing and executing instructions).
For example, the execution instruction: MOV A, #0E0H, its machine code is "74H E0H", the function of this instruction is to send the operand E0H to the accumulator,
74H is stored in the 0000H unit, and E0H is stored in the 0001H unit. When the microcontroller starts running, it first enters the instruction fetch stage, and the order is:
1 The content of the program counter (0000H at this time) is sent to the address register;
2 The content of the program counter is automatically increased by 1 (becomes 0001H);
3 The content of the address register (0000H) is sent to the memory through the internal address bus, and the address decoding circuit in the memory selects the unit with address 0000H;
4 The CPU makes the read control line valid
Previous article:MSP430 Delay Program
Next article:High-quality code writing for MSP430
Recommended ReadingLatest update time:2024-11-15 13:43
Building an AVR MCU C language development environment under Linux
Platforms and tools Operating system: Fedora 23 Development board: Arduino UNO R3 Compiler: avr-gcc Burning software: avrdude main content Installation of avr-gcc and avrdude avr-gcc compilation avrdude burning Installation of avr-gcc and avrdude sudo dnf install avr-gcc sudo dnf install avrdude avr-gcc compil
[Microcontroller]
Detailed explanation of interrupt priority related registers in the microcontroller
The content of interrupt priority includes general urgent interrupts and special urgent interrupts. This depends on the specific system design. This involves the concepts of interrupt priority and interrupt nesting. Today, I will briefly introduce the relevant registers without explaining the routines. The backgroun
[Microcontroller]
MCU Program - Dot Matrix LED Display I LVOE U
Download the schematic used in this program: click here. The microcontroller chip used is stc89c52; just find the schematic diagram of the dot matrix part. This is the circuit diagram of the entire microcontroller development board. Ignore the others.
The following is the program source code:
/******Dot matrix LED
[Microcontroller]
Application plan for realizing multi-channel data comprehensive acquisition system based on single-chip microcomputer
1. Preface In industrial control, various parameters need to be collected, that is, the signal acquisition system is used to collect various data into the computer for real-time processing. The sensor plays the role of an intermediate bridge, but the signal it outputs is often a very weak current signal, which needs t
[Microcontroller]
Summary of PIC microcontrollers
What is a PIC microcontroller?
PIC (Peripheral Interface Controller) is an integrated circuit (IC) used to control peripheral devices. It is a CPU with decentralized (multi-tasking) functions. Compared with humans, the brain is the CPU, and the shared part of PIC is equivalent to the human nervous system.
The PIC mi
[Microcontroller]
P10 dot matrix screen C51 single chip microcomputer program
P10 dot matrix screen C51 program 1/4 scan, four scans down, 1 channel 16 lines, data low OE high (04-P16-08) suitable for HUB12 interface monochrome P10 serial port mode 0, normal left shift, brightness speed adjustable, 6 IO ports, using STC8F1K08, up to 231 words. The actual picture is as follows: The
[Microcontroller]
Communication between MCU and 24C02
Origin of I2C:
The I2C (Inter-Integrated Circuit) bus is a two-wire serial bus developed by PHILIPS and is used to connect microcontrollers and their peripheral devices.
Features of I2C:
The I2C bus can be up to 25 feet long and can support 40 components at a maximum transfer rate of 10Kbps;
[Microcontroller]
Single chip microcomputer/intelligent instrument peripheral circuit design (stepping motor)
Experimental content:
Write a test program to control the operation of the stepper motor through the P0 port of the microcontroller. The wiring diagram and the level of each step are shown below.
Reference Program:
ORG 0000H
LJMP MAIN
ORG 0030H
MAIN: MOV R1,#08H
MOV DP
[Microcontroller]
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
Recommended Content
Latest Microcontroller Articles
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
MoreDaily News
- Why software-defined vehicles transform cars from tools into living spaces
- How Lucid is overtaking Tesla with smaller motors
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Three steps to govern hybrid multicloud environments
- Three steps to govern hybrid multicloud environments
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
Guess you like
- Please teach me an op amp circuit - RMS to DC circuit
- 【Silicon Labs Development Kit Review】+ PWM Example Test
- Porter-3: Will this topology work?
- Problem with the abs function
- Xunwei i.MX6ULL development board-Transplant OpenCv2.4.9-QT program compilation
- Microcontroller selection
- Made a tool to use serial port IAP to realize batch online upgrade program
- Things that electronic hardware engineers need to know
- EEWORLD University ---- Automotive/Industrial Millimeter Wave Radar Sensors
- When designing an isolation system using a linear optocoupler, the isolation strength is required to reach 1800 volts. What should be considered during the design?