User mode (user mode), the normal mode for running applications;
Fast interrupt mode (fiq mode) is used to support data transmission or channel processing;
Interrupt mode (irq mode), used for normal interrupt processing.
Super user mode (svc mode), the protected mode of the operating system
Abnormal interrupt mode (abt mode), enter or pre-fetch abnormal interrupt instructions after entering data
System mode (sys mode) is a privileged user mode used by the operating system
Undefined mode (und mode), which is entered when an undefined instruction is executed
External interrupts, abnormal operations or software control can change the interrupt mode. Most applications run in user mode. Entering privileged mode is to handle interrupt or abnormal requests or operate protection resource services.
These working modes are different environments for programs to run provided by chip hardware. Different modes have different hardware access permissions and use different registers. This provides different permission mechanisms for different programs. For example, your operating system code runs in a mode with higher permissions, while your application runs in a mode with lower permissions. This protects the operating system code.
Registers, registers visible in each mode and the functions of each register:
ARM has a total of 37 32-bit registers, 31 of which are general registers and 6 are status registers. But at the same time,
Not all registers are visible to the programmer. Whether a memory is visible (accessible) at a certain moment is a function of the
The registers in each mode are shown in Figure 1:
The registers used in system mode and user mode are the same. The registers shaded with triangles represent the registers used in different modes.
There are different physical registers.
The following is a classification description:
General registers
ARM's general registers include R0~R15, of which R0~R7 are ungrouped registers and use the same registers in all modes.
R8~R14 are independent physical registers in FIQ mode, the purpose of which is to speed up the interrupt response speed.
Save the program execution scene. R13 and R14 have their own independent registers in each mode. R15 has only
One, common to all modes.
The following is an introduction to the special functions of these registers:
Register R13: In ARM instructions, R13 is often used as a stack pointer. Each operating mode has its own independent stack, which is used to save the program running environment when an interrupt occurs and to perform process control when the C language is executed.
Register R14: Dedicated to holding the return point address, when the system executes a "jump and link" (BL) instruction
, R14 will receive a copy of R15. Otherwise, it can be used as a general-purpose register.
In other modes, the private registers R14_svc, R14_irq, R14_fiq, R14_abt and R14_und are also used to save
When an interrupt or exception occurs, or when a BL instruction is executed during an interrupt or exception, the return value of R15.
Register R15 is the program counter (PC). In ARM state, bits [1:0] of R15 are 0, and bits [31:2] store the PC.
In Thumb state, bits[0] is 0 and bits[31:1] store the PC value.
FIQ mode has 7 private registers R8-14 (R8_fiq-R14_fiq). In ARM state, most FIQ processing does not need to save any registers. User, Interrupt, Abort, Supervisor and Undefined modes have 2 private registers, R13 and R14. These modes are allowed to have a private stack pointer and link register.
Program Status Register
ARM920T has a current program status register (CPSR) and 5 saved program status registers (SPSRs) for exception interrupt processing. The functions of these registers are:
Keep information about the most recently completed ALU operation;
Control the enabling and disabling of interrupts;
Sets the operating mode of the processor.
Figure 2 below shows the bit definition of the program status register:
For the specific meaning of these bits, seethe detailed explanation of the ARM920T interrupt system . That’s all about the ARM chip knowledge related to UCOS. Of course, there is a lot more ARM chip knowledge to learn. Please refer to the 920T datasheet! ! ! !
Previous article:Overall analysis of the UCOS running process on s3c2410 - from the main function to the completion of UCOS initialization
Next article:Overall analysis of the ucos running process on s3c2410 - from power on to executing the main function
- Popular Resources
- Popular amplifiers
- 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)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- What is the difference between low inertia and high inertia of servo motors?
- CH582M-EVT development environment construction
- Are there many people using domestically produced HUAWEI MCUs?
- Mobile phone hardware R&D and design
- Research on high-speed and high-precision frequency measurement based on FPGA.docx
- EEWORLD University ---- Live playback: How to develop AI camera applications faster, simpler and at a lower cost
- Power Factor Compensation and PFC Technology
- Shanghai Semiconductor Equipment Company Recruitment: FPGA Engineer (3 years, 25-35k)
- Mixer Spurious Analysis
- High-speed PCB signal routing rules TOP9 and 12 PCB wiring skills
- UWB Ranging TOA and TDOA Detailed Explanation