MCU execution program process

Publisher:心想的45号Latest update time:2016-08-22 Source: eefocusKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
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. 

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
Keywords:MCU Reference address:MCU execution program process

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]
Detailed explanation of interrupt priority related registers in the 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]
Application plan for realizing multi-channel data comprehensive acquisition system based on single-chip microcomputer
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]
P10 dot matrix screen C51 single chip microcomputer program
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]
Single chip microcomputer/intelligent instrument peripheral circuit design (stepping motor)
Latest Microcontroller Articles
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号