Interrupts and exceptions

Publisher:Xingfu8888Latest update time:2024-07-31 Source: cnblogsKeywords:Interrupt Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Ways to detect event occurrence: polling and interruption

2 S3C2440 abnormal interrupt system block diagram

An interrupt is a type of exception.

Switching between different modes of ARM processor:

a. In the privileged level (non-user mode) operating mode, the operating mode can be switched by modifying the mode control bit of the program status register CPSR.

b. Switch the operation mode through the exception handling process.

Note that in user mode, the processor mode cannot be switched directly. It is necessary to generate exception handling and switch the processor operating mode during the exception handling process.

3 ARM Registers

Unbacked registers: shared between modes.

Backup register: exclusive to a certain mode.

Understanding the value of the program counter PC:

PC points to the instruction address at the read level, not the instruction address at the execution level. Depending on the depth of the pipeline, the offset of PC relative to the current instruction address is also different. The following takes the ARM architecture and 3-stage pipeline as an example:

The space occupied by ARM instructions is 4 bytes, so when executing the MOV instruction,

PC value = current execution level instruction address + 8

4 Exception Vector Table

Each time the CPU executes an instruction, it will detect whether an exception interrupt occurs. When an exception occurs during program execution, the program will jump to the corresponding exception vector address and perform exception handling operations. The exception vector address is related to the chip design, and this jump process is enforced by the CPU; however, exception handling is implemented by the user through code. A jump instruction can be placed at the address defined by the vector table to implement user-defined exception handling functions.

5 Abnormal interrupt response process

6 Abnormal interruption processing flow

7 Description of related registers of S3C2440 interrupt controller

8 printfException

9 und exception handling sample code

10 swi exception handling sample code

11 irq exception handling sample code


Keywords:Interrupt Reference address:Interrupts and exceptions

Previous article:System clock configuration
Next article:NAND Flash Driver

Recommended ReadingLatest update time:2024-11-23 08:02

(II) s3c2440——Serial port experiment
introduce:   Universal Asynchronous Receiver/Transmitter (UART). It is used to transmit serial data. When sending data, the CPU writes parallel data into the UART, and the UART sends it serially on a wire according to a certain format; when receiving data, The UART detects the signal from another wire and places the s
[Microcontroller]
Transplanting Qt Input Method on S3C2440
Development platform: Ubuntu 8.04 Target platform: S3c2440 Development tools: arm cross tool chain version EABI 4.3.3 Qt4 embedded SYSZUXpinyin version: SYSZUXpinyin 1.0 Source package: SYSZUXpinyin.tar.bz2         The following is the method to move SYSZUXpinyin to s3c2440, I hope it can provide a reference for every
[Microcontroller]
/sys/class/gpio file interface operation IO port (s3c2440)
The operation of GPIO is the most basic operation in embedded devices. The general approach is to write a separate driver, which is the case in most examples on the Internet. In fact, there is a universal GPIO operation interface under Linux, which is the "/sys/class/gpio" method I will introduce. First, check
[Microcontroller]
s3c2440 NAND and NOR boot methods detailed explanation + personal verification
1: Allocation of address space 1: s3c2440 is 32-bit, so it can address 4GB of space. Memory (SDRAM), ports (special registers), and ROM are all mapped to the same 4G space. 2: Development boards generally use SDRAM as memory flash (nor, nand) as ROM. Among them, nand flash has no address line, and at least one page (5
[Microcontroller]
s3c2440 NAND and NOR boot methods detailed explanation + personal verification
Design of extended serial port based on S3C2440 and embedded Linux
With the widespread use of fieldbus and other technologies, serial communication is increasingly used in various occasions. In centralized control systems, communication is required between multiple serial ports, but on general computers, there are only 1 to 3 serial ports. In order to achieve multi-point control, the
[Power Management]
Design of extended serial port based on S3C2440 and embedded Linux
s3c2440 network card interface expansion
Network is essential for embedded systems. However, s3c2440 does not have an integrated Ethernet interface, so if you want to make s3c2440 have Ethernet functions, you must expand the network card interface. Here, we connect DM9000 externally so that it can be connected to Ethernet.          DM9000 can be directly co
[Microcontroller]
S3C2440 Bare Metal Program Audio
/************************************************ *************** NAME: u2440mon.c DESC: u2440mon entry point,menu,download HISTORY: Mar.25.2002: purnnamu: S3C2400X profile.c is ported for S3C2410X. Mar.27.2002: purnnamu: DMA is enabled. Apr.01.2002:purnnamu: isDownloadReady flag is added.
[Microcontroller]
s3c2440 external interrupt
         In the above, pwm is used to control the buzzer and change the buzzer frequency. However, the buzzer keeps ringing. You can use an interactive method to turn off the buzzer. Here, we select the button. There are 4 buttons on the development board, corresponding to the 4 external interrupts EINT0, EINT1, EINT2
[Microcontroller]
s3c2440 external interrupt
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号