1) The role of resistance
[Pull-up resistor]
The resistor connected between the power supply and the reference point
(1) Function: Set the reference point level to high level by default
[Pull-down resistor]
The resistor between ground and the reference point
(1) Function: Set the reference point level to low level by default
2) Locality principle
When a program is executed, the data accessed and the instructions executed are often within a local scope.
3) bus
A group of lines that can connect multiple devices is called a bus.
(1) CPU bus
A set of lines connecting the CPU (ALU and controller) to memory and IO devices for transmitting: address, data and control
Address Lines
Data cable
Control Line
(2) Single bus (ARM)
Memory and IO devices are connected to the same CPU bus, which is manifested as:
1. Memory and IO devices are in the same address space (0 - 4G)
2. The method of accessing memory and IO devices is the same (the instructions are the same)
(3) Multi-bus (x86)
Memory and IO devices are connected to different sets of CPU buses, as shown below:
1. Are the memory and IO devices in the same address space (0 - 4G)?
2. The method of accessing memory and IO devices is the same (different instructions)
4) RISC & CISC
RISC (Reduced Instruction Set): Functions that can be implemented without hardware can be implemented with software.
CISC (Complex Instruction Set): All functions that can be implemented by hardware are implemented by hardware.
5) Eight working modes of ARM processor
(1) Normal operation
user runs the application
system runs the process context in the kernel
SVC runs the management code of the operating system
(2) Interrupt operation
IRQ (Interrupt Request) runs normal device interrupts
FIQ (Fast Interrupt Request) is used for fast or secure device interrupts
(3) Exception handling
Abort Mode in which the processing program is executed when reading instructions or storing data fails
Undefined Instruction When parsing the instruction, it is found that the instruction is illegal and the mode of running the processing program
(4) Monitor
Coetex-A Safe Mode
6) Permissions
User non-privileged mode
Other privileged modes
7) Register
Concept: A hardware-software interface is also a storage unit. A CPU core register is also a storage unit. The CPU uses the number in the register name to access the register.
Function: R0——R15 general register
R0——R7 non-backup registers
R8——R14 backup register
R13 (SP) Stack pointer register
R14 (LR) saves the return address register
R15 (PC) Program Count (the address of the instruction being read)
CPSR Status Register
SPSR Backup Status Register
8) CPSR
Status flag (generated during ALU operation)
(1) N
Whether the calculated result is a negative number (the highest digit of the saved result)
1 Negative
0 Positive number
Example: 2 - 3 = -1 N = 1
0000 0000 0000 0000 0000 0000 0000 0010
+1111 1111 1111 1111 1111 1111 1101
-----------------------------------------
1
2 - 1 = 1 N = 0
0000 0000 0000 0000 0000 0000 0000 0010
+1111 1111 1111 1111 1111 1111 1111
-----------------------------------------
10
int x, y
....
if (x > y)
(2) Z
Whether the result of the calculation is 0 (the saved result)
1 is 0
0 is non-zero
Example: 2 - 2 = 0 Z = 1
0000 0000 0000 0000 0000 0000 0000 0010
+1111 1111 1111 1111 1111 1111 1111 1110
-----------------------------------------
10
int x, y
...
if (x == y)
(3) C
Is there a carry in addition operation?
1 Carry
0 No carry
Is there a borrow in the subtraction operation?
1 No borrowing
0 There is a borrow
Example: 2 - 3 = -1 C = 0
0000 0000 0000 0000 0000 0000 0000 0010
+1111 1111 1111 1111 1111 1111 1101
-----------------------------------------
1
2 - 3 = -1 C = 0
0000 0000 0000 0000 0000 0000 0000 0010
-0000 0000 0000 0000 0000 0000 0000 0011
-----------------------------------------
unsigned int x, y;
...
if (x > y)
(4) V
Is the result of the calculation beyond the range of the complement code?
1 exceeds the range of the two's complement
0 does not exceed the range of the two's complement
Example: 0x7fffffff - (-1) = -2^31 V = 1
0 0111 1111 1111 1111 1111 1111 1111 1111
+0 0000 0000 0000 0000 0000 0000 0000 0000 0001
------------------------------------------
0 1 0
-2^31 - 1 V = 1
-2^31 +(-2^31) V = 1
-1 + -1 V = 0
1 1111 1111 1111 1111 1111 1111 1111 1111
1 1111 1111 1111 1111 1111 1111 1111 1111
-----------------------------------------
1 1 10
Summarize:
If the result of the operation is negative (saved), and V = 1, it means that the original (actual) result is positive.
Positive or 0 V = 1, negative
I bit masks IRQ interrupt
F bit masks FIQ interrupts
T bit 1 indicates that the thumb instruction is being executed and the system is in thumb state.
0 ARM ARM
Mode bit 0 - 4bit
Previous article:tq2440-arm9 transplantation (problems encountered)
Next article:About __user_initial_stackheap()
Recommended ReadingLatest update time:2024-11-16 16:18
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- 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!
- 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
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Duty cycle setting problem
- Detailed explanation of Zigbee networking principle
- Ask a question about operating ESP8266 with STM32
- How to write pointer array in stm32
- [Evaluation of domestic FPGA Gaoyun GW1N-4 series development board]——12. Two tips (multi-function pins and board silk screen)
- Questions about the CAN bus ID part
- [Classic C language knowledge] Summary of C/C++ programming difficulties
- Is this a series voltage regulator circuit?
- Shenzhen Yezhan Electronics is looking for talents||Looking forward to your joining
- 【Atria AT32WB415 Series Bluetooth BLE 5.0 MCU】Serial port test