Before introducing the interrupt handling of 2410, we have to take a look at the ARM exception vector table (Exception Vectors). Here is a brief introduction to the exception vector table (Exception Vectors):
The ARM exception vector table is generally stored at 0x00000000. ARM920T can handle 7 exceptions: Reset, Undefined instruction, Software Interrupt, Abort (prefetch), Abort (data), IRQ, FIQ
The following is a snippet of the system source code:
_start: b Handle_Reset b HandleUndef b HandleSWI b HandlePrefetchAbort b HandleDataAbort b HandleIRQ b HandleFIQ ….. |
The above snippet usually appears in an assembly file called "head.s". The statement "b Handle_Reset" is the first statement to be executed after the system is powered on, because after powering on, the CPU will fetch the first instruction from 0x00000000 of SDRAM and execute it.
0x00000000: b Handle_Reset 0x00000004: b HandleUndef 0x00000008: b HandleSWI 0x0000000C: b HandlePrefetchAbort 0x00000010: b HandleDataAbort 0x00000014: b HandleIRQ 0x00000018: b HandleFIQ |
After the system is powered on, the CPU will fetch the first instruction from the SDRAM address 0x00000000 and execute it. The terminal vector table will be placed at the address 0x00000000 as shown above. Whenever an exception occurs in the system, the CPU will check the interrupt vector table from the memory address 0x00000000 according to the exception number and perform corresponding processing. For example, if the system triggers an IRQ exception, and IRQ is exception number 6, the CPU will point the PC to the address 0x00000000 and call the interrupt service program.
The S3C2410 chip can receive 56 interrupt sources and generate 32 interrupt requests. These interrupt sources come from two parts: internal peripherals, such as DMA controller, UART, etc. and external pin lines. ARM920T has two types of interrupt modes: FIQ and IRQ, and generates IRQ or FIQ interrupts by determining the priority. If the control bit F position of the PSR (Program Status Register) in the CUP of ARM920T is 1, the CPU does not accept FIQ interrupts from the interrupt controller. If the control bit I position of the PSR (Program Status Register) in the CUP of ARM920T is 1, the CPU does not accept IRQ interrupts from the interrupt controller, so the interrupt controller generates an interrupt by clearing the F-bit or I-bit.
The interrupt exception handling module of S3C2410 consists of the following registers:
SRCPND,
INTMODE,
INTMSK,
PRIORITY,
INTPND,
INTOFFSET,
SUBSRCPND,
INTSUBMSK.
The functions of each register are described in detail below:
The SRCPND (Source Pending Register) register has 32 valid bits, which can be read and written. Each bit involves an interrupt source. SRCPND is the main interrupt source pin register. A bit set to 1 indicates that the corresponding interrupt is triggered. However, we know that the system can trigger several interrupts at the same time. As long as the interrupt is triggered, the corresponding bit of SRCPND will be set to 1, which means that several bits of SRCPND can be set to 1 at the same time. In addition, this register is not affected by the priority logic of the interrupt controller. If this interrupt is not masked by the INTMSK register or is a fast interrupt (FIQ), it will be further processed. The corresponding bit of SPCPND can be cleared by writing data to this register.
The effective bits of the INTMODE (Interrupt Mode Register) register are 32 bits, which can be read and written. Each bit corresponds to each bit in SRCPND. Its function is to specify the interrupt source processing mode (IRQ or FIQ) corresponding to the bit. If a bit is 0, the interrupt corresponding to the bit is processed in IRQ mode, and if it is 1, it is processed in FIQ mode. The initialization value of this register is 0x00000000, that is, all interrupts are processed in IRQ mode. There is only one interrupt source in this interrupt controller that can use FIQ mode (use FIQ mode under emergency interrupt), so only one bit of INTMODE can be set to 1.
The effective bit of INTMSK (Interrupt Mask Register) register is 32 bits, which can be read and written. INTMSK is the main interrupt mask register corresponding to the SRCPND register. Its function is to determine whether the interrupt request corresponding to this bit is processed. If a bit is set to 1, the interrupt corresponding to this bit will be ignored after it is generated (the CPU does not process the interrupt request). If it is set to 0, the CPU processes it. The initialization value of this register is 0xFFFFFFFF, that is, all interrupts are masked by default.
The PRIORITY (IRQ PRIORITY Control Register) register has 32 bits, with valid bits [20:0], which can be read and written. The function of this register is that if several interrupt sources are triggered at the same time, according to the flow of Figure 2.2.1, if these interrupt sources are not blocked and are all in IRQ mode, it is necessary to determine which interrupt source has the highest priority, so that its corresponding position in the INTPND register is 1, and the CPU turns to the corresponding interrupt service program to let the interrupt service program handle the corresponding interrupt request.
The effective bits of the INTPND (Interrupt Pending Register) register are 32 bits, readable and writable. It looks the same as the SRCPND register, but they actually have significant differences in function. Only one bit can be set to 1 at a time. If a bit of INTPND is set to 1 (the interrupt corresponding to this bit has the highest priority among all the interrupts that have been triggered and the interrupt is not masked), it means that the CPU is about to or has already processed the interrupt corresponding to this bit. Therefore, the SRCPND register indicates what interrupt has been triggered, while the INTPND register indicates that the CPU is about to or has already processed a certain interrupt.
The valid bits of INTOFFSET (Interrupt Offset Register) register are 32 bits and read-only. The value of this register shows which interrupt request of IRQ mode is in the INTPND register. This bit can be automatically cleared by clearing SRCPND and INTPND. FIQ mode interrupts will not affect the INTOFFSET register, so this register is only valid for IRQ mode interrupts.
The SUBSRCPND (Sub Source Pending Register) register has 32 bits, with valid bits [10:0], which are readable and writable. Each bit represents an interrupt source. SRCPND is the main interrupt source pin register, and it is the sub interrupt source pin register, which is similar to SRCPND.
The INTSUBMSK (Interrupt Sub Mask Register) register has 32 bits but the effective bits are 11 bits, which is readable and writable. If the mask bit is 0, this interrupt request is serviced, similar to INTMSK.
Previous article:Introduction to s3c2410's Bootloader (Vivi)
Next article:s3c2410_adc interrupt mode implementation
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- I searched Baidu for half an hour but couldn't find the answer. I used a search engine to find the answer in seconds.
- ESK32-360 Review] + LCD Test
- EEWORLD University Hall ---- Disassembling the front controller module of Tesla Model 3 VCFRONT
- How to use JTAG to program UCD90120A
- [N32L43X Review] 1. Breathing light
- Conaide C2000 switch quantity acquisition
- Vivado "Failed to generate and synthesize debug IPs." error solution
- Help
- How to make an electronic ballast that is not prone to damage
- Creating a Superior Smart Display Experience with DLP Pico Technology