1 SWI interrupt processing steps:
1) When entering an interrupt, pc->lr, cpsr->spsr, and cpsr_mode are set to privileged mode, all of which are completed by hardware.
2) Registering the interrupt vector table is done by software. You can use the B instruction or the ldr and dcd tables to place a jump instruction at the interrupt vector to jump to the interrupt handler.
3) The main purpose of the first-level interrupt handler is to obtain the swi number according to the arm or thumb status, and pay attention to saving registers and returning during the process.
4) The secondary interrupt handler can be written in C or assembly. It is mainly a branch structure that does the corresponding thing according to the interrupt number. It can be implemented using function pointers.
-----When using soft interrupts in an application, you can use the __swi (armcc only) keyword to declare the soft interrupt function, and automatically obtain the interrupt number when calling it.
2 IRQ interrupt based on s3c2410
First, here is a picture taken directly from the chip manual.
The previous subsrcpnd srcpnd intpnd are all SFRs provided by Samsung, which are implemented inside the chip. Their clearing method is quite special, which is to assign 1 to the corresponding bit. Considering that the setting method of external interrupts can only be driven by external events, this is not difficult to understand.
When an interrupt is sent to irq, the processing steps are as follows:
1 Check and jump to the exception vector table 0x18, take a jump instruction, and jump to the first-level irq interrupt processing function.
2 The task of the first-level interrupt handling function is to check the offset number of the interrupt source through the intoffset register, and then get the address of the second-level interrupt handling function according to the offset number and the base address, assign this address to pc, and then jump to the second-level interrupt handling function.
3 The secondary interrupt handling function may also need to check the corresponding register to obtain the specific interrupt source and then perform corresponding processing.
4 Interrupt return, because the user state cpsr has been pushed into spsr when entering the interrupt, it can be directly restored using the format of subs pc, lr, 4. Restore the original register mode and state.
to be continued. . .
Previous article:ARM learning - summary of bit operations
Next article:s3c2410 storage system
- 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
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- How haptic technology can enhance driving safety
- Let’s talk about the “Three Musketeers” of radar in autonomous driving
- 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
- OSAL principle of CC2540
- Low-power RF newsletter: ** RF module and BlueNRG-mesh **
- Radio and Radar Spectrum Complete
- The live broadcast has ended [Puyuan Jingdian 2020 New Product Launch and Industry Forum]
- Does the Mars exploration project use domestically produced chips?
- [CH549 Review] Part 1 Hardware Circuit Comparison Analysis
- EEWORLD University Hall----TI FPD-Link III automotive chipset, an ideal solution for automotive video transmission
- Live Broadcast with Prizes | Microchip Security Solutions Seminar Series
- Revolutionizing radar design with electronically reconfigurable GaN power amplifiers
- EEWORLD University - MSP430FR2433 ADC wake-up and transmission exercises