TQ210——S5PV210 interrupt system

Publisher:勾剑寒Latest update time:2020-12-06 Source: eefocusKeywords:TQ210 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

An interruption means that when the CPU is executing a program, it encounters an abnormal situation that needs to be handled. The CPU stops the current program, saves the necessary parameters of the current program, and turns to handle these abnormal situations. After the processing is completed, the CPU returns to the interruption point of the current program and continues to execute the original program.

1. Exception vector table

2. Level 1 exception handling


#define pExceptionIRQ ( *((volatile unsigned long *)(0xD0037418)) )

pExceptionIRQ = (unsigned long)IRQ_handle;

IRQ_handle:    

                   sub lr, lr, #4 // Save the scene                    

   stmfdsp!, {r0-r12, lr}      

                   bl irq_handler // Jump to interrupt handling function

                   ldmfd sp!, {r0-r12,pc}^ // restore the scene


3.VICX

The S5PV210 has a total of 4 VICs (Vectored Interrupt Controllers), which are interconnected in a daisy chain manner to support up to 93 interrupt sources.


These interrupt sources provide interrupt services for system DMA, timers, peripherals, multimedia, audio, security and other modules.


The interrupt types include IRQ and FIQ, both of which are level 2 in interrupt processing.


The daisy-chained 4 TZICs and 4 VICs are designed to support 93 interrupt sources. In the trusted domain design, the TZIC provides a soft interrupt for the secure interrupt system. It provides secure control of the nFIQ interrupt and the interrupt controller masks the interrupt source on systems without a security margin (vic). The latter is used to generate the nIRQ signal.


Daisy Chain: A method of transmitting signals along a bus in which devices are connected in series and signals are passed from one device to the next. The daisy chaining method assigns priority to devices according to their electrical position on the bus.


4. Register

(1) IRQSTATUS interrupt status


(2) VICINTSELECT (interrupt type selection: irq or fiq)

How to ensure that FIQ has the best interrupt response speed?

<1> FIQ mode has more banked registers, so the time wasted on saving registers can be avoided after entering the FIQ ISR.

<2>, FIQ is at the end of the exception vector table, so the ISR can start directly at the end of the vector table without jumping elsewhere.


(3) VICINTENABLE/VICINTENCLEAR (interrupt enable/disable setting)


In the interrupt enable register, each bit represents an interrupt source. Writing 1 to the corresponding bit in the VICINTENABLE register enables the interrupt (writing 0 is invalid, and when reading, it returns 1 if the interrupt is enabled, and 0 if it is not enabled), while writing 1 to the corresponding bit in the VICINTENCLEAR register disables the interrupt (writing 0 is invalid).

In some other CPUs, there is only one INTENABLE register. Writing 1 enables interrupts, and writing 0 disables interrupts.


(4) ISR related


How to set up ISR:

The interrupt system of S5PV210 adopts the following ISR determination strategy

<1> Divide the 93 interrupt sources into 4 groups. The ISRs of each group form an array with the interrupt number as the array index.

<2> The first addresses of the four ISR arrays are stored in VICVECTADDR0~VICVECTADDR3 respectively.

When binding an ISR, you only need to put the ISR address written by the user into the position indexed by the interrupt number in the ISR array.

How to obtain ISR:

When an interrupt occurs and jumps to IRQ in the first-level exception vector table, the scene must be protected first, and then the corresponding ISR is entered for execution.

To obtain the corresponding ISR, you only need to read the VICADDRESS register. This is because the interrupt system of S5PV210 will automatically push the ISR corresponding to the current interrupt from ICVECTADDRx to VICADDRESSx. This saves us the trouble of confirming the interrupt number using the query method and improves the response speed of IRQ.

 

5. Interrupt handling

Interrupt handling process

<1>, hardware event occurs, SRCPENDING bit response hangs

<2>, determine whether to generate an interrupt pending INTPENDING according to the interrupt enable setting, and determine whether the interrupt type is IRQ or FIQ according to INTSELECT

<3>, in response to the interrupt, the CPU automatically jumps to the IRQ or FIQ exception entry according to the first-level exception vector table

<4> For IRQ, in the secondary interrupt table, judge according to INTNUM and jump to the corresponding ISR for execution

<5>, interrupt returns, and this interrupt event ends

 

How to use interrupts:

<1>, Global settings, including setting the first-level exception vector table, clearing all interrupt hangs, disabling all interrupt sources, etc.

<2>, Make specific settings for the interrupts to be used, including setting the interrupt type to IRQ/FIQ, interrupt enable, priority, etc.

<3>, Bind the interrupt handler so that it can jump to the correct ISR when the secondary interrupt is processed. 

<4> Set the interrupt enable bit to allow interrupts to occur.

      Differences in interrupt handling on different platforms: some platforms set the interrupt bit to 1, while others clear the interrupt bit to 0; the way to obtain the interrupt number (which means obtaining the interrupt ISR) during a secondary interrupt is different. These differences will affect the interrupt response speed of the platform.

 

6. External interrupt

External interrupts refer to interrupts from outside the SoC, as opposed to internal interrupts (interrupts from inside the SoC, i.e., interrupts generated by various internal peripherals, such as timer interrupts).


S5PV210 supports 32 channels of external interrupts, each of which has a corresponding GPIO to receive interrupt signals from the outside. There are five optional interrupt trigger modes: level (high, low), edge (rising edge, falling edge, Both).      

(1) EXT_INT_0_CON external interrupt control register

EXT_INT_x_CON (x = 0~3) is used to configure the trigger mode of 32 external interrupt channels.


(2) EXT_INT_0_MASK external interrupt enable/disable

EXT_INT_x_MASK (x=0~3) is used to enable/disable the corresponding external interrupt channel


(3) EXT_INT_0_PEND external interrupt pending register

           

EXT_INT_xPEND (x=0~3) is used to mark the external interrupt pending. Writing 1 to the corresponding bit can clear the interrupt pending.

 

6. External interrupt setting process

<1>, Global interrupt initialization

<2>, set the corresponding GPIO to XEINTx

<3>, Bind interrupt handler

<4>, set EXT_INT_x_CON to configure the trigger mode

<5>, write EXT_INT_x_PEND to clear the interrupt

<6>, set EXT_INT_x_MASK to enable the corresponding channel

<7>, finally enable the corresponding external interrupt channel


analyze:

1. When an interrupt hang occurs, the CPU automatically jumps to the IRQ entry address in the first-level exception vector table.

2. Get the corresponding ISR address through IRQSTATUS and VICADDRESS mechanism and start execution.

3. The internal content of ISR should include three parts:

(1) Valid isr, handle the task corresponding to the key

(2) Write any value to VICxADDR to clear the interrupt

(3) Write 1 to EXT_INT_x_PEND to clear the corresponding interrupt 


Keywords:TQ210 Reference address:TQ210——S5PV210 interrupt system

Previous article:TQ210——Button (interrupt query method)
Next article:TQ210——Clock System

Recommended ReadingLatest update time:2024-11-15 07:18

TQ210 - Light up the LED
1. Introduction to S5PV210 GPIO Hardware 1.1. GPIO       GPIO stands for General-Purpose IO ports. In embedded systems, there are often a large number of external devices/circuits with relatively simple structures. Some of these devices/circuits require the CPU to provide control means, while others need to be used
[Microcontroller]
TQ210 - Light up the LED
S5PV210 hours
TCFG0, R/W, Address = 0xE250_0000 Timer Input Clock Frequency = PCLK / ( {prescaler value + 1} ) / {divider value} TCFG1, R/W, Address = 0xE250_0004 CON, R/W, Address = 0xE250_0008 TCNTB4, R/W, Address = 0xE250_003C Example #define TCFG0 (*(unsigned int*)0xE2500000) #define TCFG1 (*(unsigned int*)0xE2500004
[Microcontroller]
S5PV210 hours
S5PV210 Development -- TTL and CMOS Levels
Next, let’s talk about S5PV210 development – ​​UART detailed explanation, which mentions TTL and RS232 levels. RS232 Level Logic 1: -3V~-15V Logic 0: +3V~+15V TTL level Logic 1: +2V~+5V Logic 0: +0V~+0.8V 1. What is logic level To understand the content of logic level, you must first know the meaning of the foll
[Microcontroller]
S5PV210 Development -- TTL and CMOS Levels
TQ210——Frequently Asked Questions
1. How many V does the TQ210 board use for power supply? How many inches of screen can it be connected to? What kind of screen is it?      The TQ210 V3 version uses a 12V1A stable power supply, and the TQ210V4 version uses a 5V2A stable power supply. Both versions can use a 7-inch TN92 capacitive screen or a resistive
[Microcontroller]
ARM processor startup process——S3C2440, S3C6410, S5PV210
S3C2440 Support booting from norflash and nandflash. Nandflash does not participate in unified addressing. The CPU always fetches instructions from the address 0. In order to boot from nandflash, the S3C2440 chip first copies the first 4kB of nandflash to the SRAM in the chip called stepping stone when the CPU starts.
[Microcontroller]
S5PV210 IRAM Application
Prepare for analysis The size of IRAM is 96k. Actually, the first two programs are run here. The programs are smaller than 16K. What needs to be achieved is to copy the first 16k of IRAM from the starting address 0xD0020000 of IRAM to 0xD0024000 and call main. The stack pointer is set to 0xD003_7D80. The link addres
[Microcontroller]
S5PV210 IRAM Application
S5PV210 (TQ210) study notes - system clock and serial port
The system clock configuration and serial port configuration of TQ210 are very simple. This article starts with the system clock configuration of TQ210. The clock configuration of TQ210 is similar to that of 2440/6410, except that the number of phase-locked loops is slightly different. The configuration steps are the
[Microcontroller]
S5PV210 (TQ210) study notes - system clock and serial port
Uart application of S5PV210
Prepare for analysis S5PV210 NandFlash application (I) has many bugs, so we need to get Uart out first. Uart is usually related to clock, but the code in IROM has increased PCLK to 66.5MHZ, so we will not set CLOCK here.        Resource Tools Same as "LED Application of S5PV210 (I)" Start writing the program To
[Microcontroller]
Uart application of S5PV210
Latest Microcontroller Articles
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号