ARM interrupt difference - the difference between LPC2142 and S3C2440

Publisher:数字驿站Latest update time:2016-12-31 Source: eefocusKeywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

/***************************************************
 *Description: Difference between ARM interrupts - Difference between LPC2142 and S3C2440
 ***************************************************/

    The difference between LPC and Samsung ARM is that Samsung has fixed the address of interrupt vector, while LPC does not.

All interrupt sources have corresponding interrupt vectors. 

  • About Samsung ARM

 

(1) Using vector interrupts 

ENTRY

b ResetHandler                                  ;   0x00

b HandlerUndef                                  ;   0x04

b HandlerSWI                                    ;   0x08

b HandlerPabort                                 ;  0x0c

b HandlerDabort                                 ;   0x10

b .                                            ;   0x14

b HandlerIRQ                                    ;   0x18

b HandlerFIQ                                    ;   0x1c

 

ldrpc,=HandlerEINT0                           ;   0x20

ldrpc,=HandlerEINT1

ldrpc,=HandlerEINT2

ldrpc,=HandlerEINT3

ldrpc,=HandlerEINT4567

ldrpc,=HandlerTICK                            ;   0x34

b.

b.

ldrpc,=HandlerZDMA0                           ;   0x40

ldrpc,=HandlerZDMA1

ldrpc,=HandlerBDMA0

ldrpc,=HandlerBDMA1

ldrpc,=HandlerWDT

ldrpc,=HandlerUERR01                          ;   0x54

b.

b.

ldrpc,=HandlerTIMER0                          ;   0x60

ldrpc,=HandlerTIMER1

ldrpc,=HandlerTIMER2

ldrpc,=HandlerTIMER3

ldrpc,=HandlerTIMER4

ldrpc,=HandlerTIMER5                          ;   0x74

b.

b.

ldrpc,=HandlerURXD0                           ;   0x80

ldrpc,=HandlerURXD1

ldrpc,=HandlerIIC

ldrpc,=HandlerSIO

ldrpc,=HandlerUTXD0

ldrpc,=HandlerUTXD1                            ;   0x94

b.

b.

ldrpc,=HandlerRTC ; 0xa0

b.

b.

b.

b.

b .

b.

ldrpc,=HandlerADC                             ;   0xb4


Detailed analysis: The biggest difference is that ldr pc, = HandlerEINT0 starts differently. Samsung ARM makes proper use of these addresses to easily complete the interrupt jump.


 

(2) Do not use vector interrupts 

ENTRY

b ResetHandler                                 ;  for debug

b HandlerUndef ; handlerUndef

b HandlerSWI                                   ;  SWI interrupt handler

b HandlerPabort                                ;  handlerPAbort

b HandlerDabort                                ;  handlerDAbort

b .                                           ;  handlerReserved

b IsrIRQ

b HandlerFIQ

. . . . . .

 

IsrIRQ

sub             sp,sp,#4                       ;  reserved for PC

stmfd sp!,{r8-r9}

 

ldr             r9,=I_ISPR

ldr             r9,[r9]

move r8, #0x0

0               movs            r9,r9,lsr #1

bcs             %F1

add             r8,r8,#4

b %B0

 

1               ldr             r9,=HandleADC

add             r9,r9,r8

ldr             r9,[r9]

str             r9,[sp,#8]

ldmfd           sp!,{r8-r9,pc}

.. . . . .

HandleADC #4

HandleRTC               #       4

HandleUTXD1           #         4

HandleUTXD0           #         4

.. . . . .

HandleEINT3           #         4

HandleEINT2 # 4

HandleEINT1           #         4

HandleEINT0           #         4                              ;  0xc1(c7)fff84

 

Detailed analysis:

The big difference is IsrIRQ, and another difference is that IsrIRQ does not perform the sub lr,lr,#4 operation.

 

The reason is that there is no function call here, so lr is still

It is the value of lr saved before entering the interrupt. Because when the function is added with the __irq keyword (interrupt service function),

The compiler automatically adds the

sub lr,lr,#4

stmfd sp!,{r0-r3,r12,lr} (only pushes r0-r3,r12,lr. When the ARM kernel enters an interrupt, the default stack is r4-r7)

.....

ldmfd sp!,{r0-r3,r12,pc}^

Note: IsrIRQ is not reentrant.

 

; The reason why sub lr,lr,#4 does not appear here is that there is no function call here, so lr still

; is the value of lr saved before entering the interrupt. Because when the function is added with the __irq keyword (interrupt service function),

; The compiler automatically adds before executing the interrupt service function

; sub lr,lr,#4

; stmfd sp!,{r0-r3,r12,lr} (only pushes r0-r3,r12,lr. When the ARM core enters an interrupt, it pushes r4-r7 by default)

; .....

; ldmfd sp!,{r0-r3,r12,pc}^

; NOTE: IsrIRQ is not reentrant.

 

  • About ARM on LPC

For LPC ARM, we should pay special attention to the VICVectAddr register. Why do we say that?

 

LDR     PC, ResetAddr

LDR     PC, UndefinedAddr

LDR     PC, SWI_Addr

LDR     PC, PrefetchAddr

LDR     PC, DataAbortAddr

DCD     0xb9205f80

LDR     PC, [PC, #-0xff0]

LDR     PC,FIQ_Addr


Detailed analysis:

    The address of LDR PC, [PC, #-0xff0] is 0x18, so what is the value pointed to by PC at this time? We can calculate it like this

PC=0x18+8-0xff0=0xfffff030, which is exactly the address of the VICVectAddr register, and VICVectAddr stores the address of the interrupt routine to be executed, because when an interrupt occurs, the hardware automatically copies the values ​​of VICVectAdd0 and VICVectAddr1 to VICVectAddr.

   Therefore, LPC can achieve interruption by setting an address similar to VICVectAdd0.


Keywords:ARM Reference address:ARM interrupt difference - the difference between LPC2142 and S3C2440

Previous article:ARM9 interrupt debugging (1)
Next article:S3C2440 I2C Implementation

Recommended ReadingLatest update time:2024-11-16 12:54

ARM Technology independently develops IP and standards based on ARM technology in line with the needs of the Chinese market
In 2018, ARM completed the split of its China business and established a joint venture company with the Chinese side holding 51%. As the headquarters of ARM's IP business in China, ARM Technology (China) Co., Ltd. will provide integrated circuit intellectual property (IP) licensing and technical services to partners h
[Embedded]
ARM Technology independently develops IP and standards based on ARM technology in line with the needs of the Chinese market
Labels in ARM assembly
      A label (LABEL) is a name given to a group of machine instructions, which represents the symbol of the instruction or data address in the program. The label is optional, and is only assigned to the statement when the symbolic address is needed to access the statement. By putting a label in front of the target add
[Microcontroller]
ARM Basic Knowledge
In addition to normal saving, after compiling correctly, choose to save as a .h file with the same name, and change the main function name in the h file to other names, such as xmain, or main1, etc., then the new project can call the function in the original project! 1. Project 1 first write LCD1602, and after compili
[Microcontroller]
TQ210 —— LCD
1. LCD controller 1. S5PV210 LCD controller To make an LCD display text or images normally, it requires not only an LCD driver but also a corresponding LCD controller. Under normal circumstances, manufacturers will make the LCD driver together with the LCD glass substrate in the form of COF/COG, and the LCD controller
[Microcontroller]
TQ210 —— LCD
ARM9 Learning 1-Installation and Use of Keil uVision 4.14
1. Assembly language preparation ----- Installation of editor RealView MDK Keil uVision 4.14 1. First, double-click the welcome interface of Keil u Vision 4.14 2. After next, the interface for accepting the installation is displayed. 3. After next, the custom installation directory interface 4. After ne
[Microcontroller]
ARM9 Learning 1-Installation and Use of Keil uVision 4.14
Arm Learning Notes--ADC Programming
 The function of the A/D converter is to sample the analog input signal to obtain a digital signal that can be processed by the computer. The circuit diagram of the A/D input module of the development board is as follows  This is a circuit that measures voltage.     The ADC of LPC1788 is a 12-bit successive a
[Microcontroller]
Arm Learning Notes--ADC Programming
uboot porting on s3c2440 (6)
1. Transplantation Environment Host: VMWare--Fedora 9 Development board: Mini2440--64MB Nand, Kernel: 2.6.30.4 Compiler: arm-linux-gcc-4.3.2.tgz u-boot:u-boot-2009.08.tar.bz2 2. Transplantation Steps 10) u-boot uses tftp service to download the kernel and use
[Microcontroller]
uboot porting on s3c2440 (6)
Learn ARM development(20)
With the previous Tick interrupt, the basic task switching conditions are "everything is ready, only the east wind is missing". However, this "east wind" is also difficult to understand, and only through continuous practice can we find the right method. Now I need to find this east wind, which is to solve the proble
[Microcontroller]
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号