A brief discussion on the interrupt register and interrupt process of S3C2440

Publisher:名字太长了吗Latest update time:2015-11-17 Source: eefocusKeywords:S3C2440 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

S3C2440 has a total of 60 interrupt sources, of which 15 are sub-interrupt sources, which correspond to each bit in the SUBSRCPND register, and the other 45 interrupt sources correspond to each bit in SRCPND. It should be noted that EINT4~7 correspond to the same bit SRCPND[4], and EINT8~23 also correspond to SRCPND[5].

1 S3C2440 interrupt register

         Interrupts are divided into two categories: external interrupts and internal interrupts.
1.1 External Interrupt Register
         24 external interrupts occupy GPF0-GPF7 (EINT0-EINT7), GPG0-GPG15 (EINT8-EINT23). If you use these pins as interrupt inputs, you must configure the pins as interrupts and do not pull them up. For details, please refer to the datesheet data manual.
Registers:
             EXTINT0-EXTINT2: Set the trigger mode of EINT0-EINT7, EINT8-EINT15, EINT16-EINT23 respectively (high level trigger, low level trigger, falling edge trigger, rising edge trigger).
             EINTFLT0-EINTFLT3: Control the filter clock and filter width.
             EINTPEND: This is the interrupt pending register. When clearing, write 1. There are several more to write 1 to clear. When an external interrupt (EINT4-EINT23) occurs, the corresponding bit will be set to 1. Why there is no EINT0-EINT3, because they are controlled by the last 4 bits of the SRCPND register.
           EINTMASK: This is simple, it is used to mask interrupts, that is, when the bit is 1, the interrupt is invalid.
1.2 Internal Interrupt Register
           There are 8 internal interrupt registers.
Register:
           SUBSRCPND: When an interrupt occurs, the corresponding bit will be set to 1, indicating that an interrupt has occurred.
           INTSUBMSK: Same as the previous one, interrupt mask register.
           SRCPND: When an interrupt occurs, the corresponding bit will be set to 1, indicating that one or a class of interrupts has occurred.
           INTMSK: Used to mask the interrupt identified by the SRCPND register. But only IRQ interrupts can be masked, not FIQ interrupts.
           INTMOD: When a bit in INTMOD is set to 1, the corresponding interrupt is set to FIQ, and the CPU will enter the fast interrupt mode.
           PRIORITY: Used to set the priority of the IRQ interrupt. For specific usage, please refer to the chip manual.
           INTPND: After the interrupt priority arbiter selects the interrupt with the highest priority, the corresponding bit of this interrupt in the INTPND register is set to 1, and then the CPU enters the interrupt mode to handle it. At the same time, only one bit of this register is set to 1.
           INTOFFSET: Used to indicate which bit in the INTPND register is set to 1, that is, to record the value of bit x in INTPND where bit [x] is 1. Automatically cleared when INTPND and SRCPND are cleared.
1.3 Relationship between registers:
Figure 1 Relationship between interrupt registers

2 Interruption process

2.1 Internal interrupt process
a If it is an internal interrupt without sub-interrupt: after it occurs, the corresponding position of SRCPND is set to 1. If it is not masked by INTMSK, it waits for further processing.
b If it is an internal interrupt with sub-interrupt: after it occurs, the corresponding position of SUBSRCPND is set to 1. If it is not masked by INTSUBMSK, the corresponding position of SRCPND is set to 1, waiting for further processing. Several SUBSRCPNDs may correspond to the same SRCPND. The corresponding table is as follows:
 
2.2 External interrupt process
a If it is an external interrupt: After EINT0-EINT3 occurs, the corresponding position of SRCPND is set to 1. If it is not masked by INTMSK, it waits for further processing. After EINT4-EINT23 occurs, the corresponding position of EINTPEND is set to 1. If it is not masked by EINTMASK, the corresponding bit EINT4-7 or EINT8-23 of SRCPND is set to 1. If it is not masked by INTMSK, it waits for further processing. Several EINTPENDs correspond to the same SRCPND. The corresponding table is as follows:
 

           All three interrupts are waiting for further processing. Next, look down from SRCPND to INTMSK. If the interrupt is blocked, there is no need to say anything (note: fast interrupts can also be blocked). If it is not blocked, it will go further to INTMOD. If it is a fast interrupt, it will come out directly and enter FIQ (that is, the CPU enters fast interrupt mode for processing). If it is a normal interrupt, then SRCPND can be set to 1 multiple times (FIQ can only have one), then PRIORITY will be used to select a high priority, and then the corresponding position of INTPND will be set to 1 according to the selected interrupt (note: only one can be selected), enter IRQ, and let the CPU process it.
2.3 Enabling interrupts
a. If it is an internal interrupt without sub-interrupt, just set INTMSK to make it unmask the interrupt.
b. If it is an internal interrupt with sub-interrupt, set INTSUBMSK and INTMSK to make them unmask the interrupt.
c. If it is an external interrupt, for EINT8-23, you need to set EINTMASK and INTMSK. For EINT0-EINT3, you only need to set INTMSK.
2.4 Clearing Interrupts
a. If it is an internal interrupt without sub-interrupt, just clear SRCPND. Note that the clearing position needs to be 1.
b. If it is an internal interrupt with sub-interrupt, clear SRCPND and SUBSRCPND. Note that SUBSRCPND should be cleared first, then SRCPND. Because if you clear SRCPND first, then in the process of clearing SUBSRCPND, SRCPND will think that another interrupt has occurred and will be set to 1 again. In other words, an interrupt will be responded to twice. So the source must be cut off first.
c. If it is an external interrupt, for EINT8-23, you need to clear EINTPEND and SRCPND (also pay attention to the order). For EINT0-EINT3, you only need to clear SRCPND.

Keywords:S3C2440 Reference address:A brief discussion on the interrupt register and interrupt process of S3C2440

Previous article:S3C2440 clock system
Next article:ARM link address and programming address

Recommended ReadingLatest update time:2024-11-16 17:36

Construction of embedded Linux root file system based on S3C2440
Embedded Linux has long been a household name in the IT industry. Using Linux for embedded product development has a great advantage, which is that the development resources are abundant and the cost is low. The embedded Linux operating system is gaining more and more attention and its application is becoming more and
[Microcontroller]
Construction of embedded Linux root file system based on S3C2440
s3c2440 bare metal - abnormal interrupt 3 - swi soft interrupt
swi (soft interrupt) We know that arm has 7 working modes, except for the usr mode, the other 6 are privileged modes. We know that the usr mode cannot modify CPSR to directly enter other privileged modes, but Linux applications generally run in the usr mode. Since the usr mode has very low permissions and canno
[Microcontroller]
S3C2440 RTC bare metal program
The RTC (Real Time Clock) unit can work with a backup battery when the system power is turned off. The RTC can send 8-bit binary-decimal (BCD) value data to the CPU using the STRB/LDRB ARM operation. This data includes time information such as year, month, day, week, hour, minute and second. The RTC unit works with an
[Microcontroller]
S3C2440 Memory SDRAM Control Notes
In the past year or so, I have been engaged in the research and practice of arbitrary gear robot motion control and inertial navigation. The development board I bought has been idle for more than a year, and I decided to continue what I learned more than a year ago and continue taking notes. SDRAM read and write ope
[Microcontroller]
How to use JLink to indirectly burn Nor and Nand Flash of S3C2410 and S3C2440 development boards
1. Brief description JLink's debugging and Flash burning functions are very powerful, but the Flash operations of S3C2410 and S3C2440 are a bit troublesome: SDRAM needs to be set when burning Nor Flash, otherwise the speed is very slow; burning Nand Flash is only theoretically possible, but no one has directly impleme
[Microcontroller]
How to use JLink to indirectly burn Nor and Nand Flash of S3C2410 and S3C2440 development boards
Let's learn mini2440 bare metal development (Part 4) -- S3C2440 timer learning
Overview of S3C2440 Timer Principle The s3c2440 has five 16-bit timers, timers 0, 1, 2, and 3 have pulse width modulation (PWM) functions, so these four timers are also called PWM timers. Timer 4 is an internal timer with no external output pins. The clock source of the timer is PCLK. The frequency required for t
[Microcontroller]
Let's learn mini2440 bare metal development (Part 4) -- S3C2440 timer learning
Writing the S3C2440 block device driver to simulate a hard disk using memory (Twenty-one)
Refer to the kernel's built-in block device driver: drivers/block/xd.c drivers/block/z2ram.c 1. The structures required in this section are as follows: 1.1 gendisk disk structure: struct gendisk { int major; //Device major number, equal to major in register_blkdev() function int first_minor; //The starting
[Microcontroller]
Writing the S3C2440 block device driver to simulate a hard disk using memory (Twenty-one)
s3c2440 bare metal-memory controller (3-2, adaptive access timing of norflash programming)
Earlier we learned about the characteristics and principles of norFlash , so how does the CPU communicate with norFlash? Let’s start with the detailed introduction. 1. Memory controller adapted to norflash The figure shows the programmable access cycle read and write timing of the S3C2440 memory controller. The time p
[Microcontroller]
s3c2440 bare metal-memory controller (3-2, adaptive access timing of norflash programming)
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号