【Contents of this chapter】
(It feels similar to normal users and super users in Linux)
R8-R12 are grouped registers: depending on the current processor mode;)
Reset: reset interrupt;
(Here, we can think about it in detail in combination with the 3-stage pipeline processing structure of ARM7, but why not save PC-8 in R14 in the first step?)
Keywords:ARM
Reference address:ARM Microprocessor Programming Model
Understand the structural characteristics of ARM
Understand the working mode of ARM programming
Learn about ARM's internal resources
Understand ARM's exception handling mechanism
【Chapter Structure】
【Working status of ARM microprocessor】
The ARM9 processor core uses the VT4 version of the ARM structure and has two operating states.
1) ARM state: 32 bits, executing word-mode ARM instructions;
2) Thumb state: 16 bits, executing half-word Thumb instructions;
(Both ARM and Thumb states are executing programs, but the length of the commands is different, similar to the nitrogen state and normal state in KartRider)
Register working mode
1) User and system modes;
(It feels similar to normal users and super users in Linux)
2) Abnormal mode
3) 7 register working modes supported by ARM9 processor
(ARM9 has 7 working modes, corresponding to 7 different register combinations (combinations of 37 internal registers))
[Organization of registers in ARM state]
1) General registers
(31 32-bit general purpose registers and 6 status registers (similar to a microcontroller))
R0-R12 are general registers for storing data or addresses and are not used for special purposes by the system or structure;
(R0-R7 are ungrouped registers: they can be used in any processor mode;
(R8-R12: There are two grouped physical registers, providing a register dedicated to FIQ mode, which can speed up FIQ processing)
R13: Stack pointer (SP); there is no special R13 instruction in the ARM instruction set; there is an R13 instruction in Thumb
R14: Link register (LR), which has two special functions in structure (1. R14 of the mode itself is used to save the subroutine return address, 2. When an exception occurs, it is used to save the exception return address) [page]
2) Program Status Register (CPSR)
mode: indicates the working status of the processor
·T: 0, ARM state; 1, Thumb state;
Interrupt disable bits
I=1:Disables the IRQ
F=1: Disable the FIO
·condition code flags
N = Negative result from ALU (non-zero)
Z = Zero result from ALU
C = ALU operation Carried out
V = ALU operation Overflowed
v5, v6
Q: dsp extension unit
J: Java accelerator
(There are two ways for the processor to store data, big endian and little endian
Big endian: high byte in low order, low byte in high order
Little endian: high byte in high order, low byte in low order
*Old versions only support little-byte order, but now all versions are supported, and Linux network programming uses big-byte order)
[Exceptions supported by ARM]
(The processor will enter exception mode whenever the normal program flow is temporarily suspended. Before handling the exception, the ARM9 core saves the current processor state (CPSR->SPSR) so that when the processor ends it can resume execution of the original program (SPSR->CPSR))
Reset: reset interrupt;
Undefineed Instruction: Undefined instruction;
Software Interrupt: Software interrupt
Prefetch Abort: Prefetch instruction abort;
Date Abort: Data abort;
IRQ: external interrupt;
FIQ: Fast Interrupt Request;
Abnormal response
1) Entering exception:
*LR stores the address of the next instruction after the currently executed instruction: LR=PC-4
*CPSR->SPSR (retain status)
*CPSR->status corresponding to the exception type
* PC is fetched from the associated exception vector
* Jump, execute command
2) Return from an exception
*SPSR->CPSR
*The LR register value minus an offset is copied to the PC register and the interrupted user program is jumped
(Here, we can think about it in detail in combination with the 3-stage pipeline processing structure of ARM7, but why not save PC-8 in R14 in the first step?)
Previous article:AVR reads keyboard using IF statement
Next article:MEGA16 game development board driver
Recommended ReadingLatest update time:2024-11-17 06:57
Research and Application of Image Data Acquisition System Based on ARM7
Image data acquisition systems are widely used in defense, industry, medicine, household and scientific research. The image sensors used in these systems are mainly CCD and CMOS arrays. Among them, CMOS has the characteristics of high integration, simple voltage supply circuit, low cost and low technical level compa
[Microcontroller]
2.3 [Bare Metal Part] Mastering the ARM Chip Clock System
1. Clock Architecture CPU-FCLK:400MHZ AHB bus-HCLK: 136MHZ APB bus-PCLK: 68MHZ Documentation explanation: Chinese translation: FCLK, HCLK and PCLK, FCLK is used by ARM920T. HCLK is used for AHB bus, which is used by ARM920T, memory controller, interrupt controller, LCD controller, DMA and USB host block. PCLK
[Microcontroller]
Embedded Linux Code Transplantation Based on ARM9
0 Introduction
With the rapid development of computer technology, communication technology and the Internet, embedded systems have been increasingly widely used. At the same time, the complexity of embedded systems is also increasing, and embedded operating systems have become the most important component. At pr
[Microcontroller]
Multi-sensor data fusion fire alarm system based on ARM9
In view of the fact that a single ordinary type of fire detection alarm can no longer meet the demand, the use of multiple sensors to comprehensively collect various abnormal information before a fire occurs, and the use of multi-sensor information fusion technology to process the fire information provided by the se
[Microcontroller]
ARM's seven working modes
1. 7 working modes of ARM processor (privileged mode, privileged mode, exception mode) User mode (USR): Normal program execution mode, cannot be switched directly to other modes System mode (SYS): Privileged tasks running the operating system, similar to user mode, but with privileges such as being able to switch di
[Microcontroller]
ARM reads DS1302 assembly program
GPACON EQU 0x56000000 GPADAT EQU 0x56000004 GPAUP EQU 0x56000008 EXPORT xmain AREA Init,CODE,READONLY ENTRY xmain ldr r0,=GPACON
[Microcontroller]
Professional engineers explain the difference between ARM and MCU
1. Software: This is probably the biggest difference. The operating system was introduced. Why was the operating system introduced? What are the benefits? 1) Convenience. This is mainly reflected in the later development, that is, developing applications directly on the operating system. Unlike a single-chip microco
[Microcontroller]
Learn ARM development (2)
It was Sunday, and I was just resting at home. It was a good time to learn ARM. I got up
very early in the morning because I was always anxious about how to set up the ARM development environment. I couldn't sleep well. I immediately turned on the computer. In order to speed up, I turned on both computers at hom
[Microcontroller]
Recommended Content
Latest Microcontroller Articles
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
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
MoreDaily News
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
Guess you like
- New uses for old phones (8) - Remote access
- DSP decimal conversion
- [Jihai APM32E103VET6S MINI Development Board Review] Part 5: Software Triggering ADC
- Huawei FPGA Design Complete Collection
- DC-DC output capability
- Recent hot selling products:
- "Recommended Chinese Chip" + JieFa AC781x ARM Chip
- 5 important attributes of EMC analysis
- Bandwidth Management System (BWM) for TI C64x+ DSPs
- Xunwei RK3399 development board supports installing Docker in Ubuntu system