1. It is necessary to call the MMU function to implement memory mapping;
2. After the interrupt is triggered and the interrupt processing function is entered, the corresponding bits of SRCPND and INTPND must be cleared first. If the secondary interrupt source is used, such as EINT4 in EINT4_7, the corresponding bit of EINTPEND must be cleared. Generally speaking, the corresponding bit of the secondary interrupt source should be cleared first, and then the interrupt source, otherwise the interrupt source will cause multiple interrupts. After the clearing is completed, specific processing can be performed.
#include "def.h"
#include "option.h"
#include "2440addr.h"
#include "2440lib.h"
#include "2440slib.h"
#include "mmu.h"
#define LED1 (1<<5) //must be "()"
#define LED2 (1<<6)
#define LED3 (1<<7)
#define LED4 (1<<8)
#define KEY1
#define KEY2
#define KEY3
#define KEY4
//void delay_ms(U32 i);
void init_irq(void);
void MMU_Init(void);
int Main(void)
{
}
void delay_ms(U32 i)
{
}
void key_per(void)
{
}
void __irq key1_3_4(void)
{
}
void __irq key2(void)
{
}
//Since key2 corresponds to GPF4 in the circuit diagram, the corresponding interrupt function is EINT4, which is specifically determined by the secondary interrupt register
//EINTMASK is used to enable it. In init_irq(), since the interrupt processing function needs to be mapped, key2 is written separately here to make the program clear.
void init_irq(void)
{
//The following is to map the addresses of key1_3_4 and key2 functions to the interrupt vector table, so that when the interrupt is triggered, it jumps to the address of the corresponding function to execute
//Execute this function. If the EINT0 interrupt is triggered, the function key1_3_4 will be executed.
}
Previous article:ARM startup method
Next article:S3C2440 timer 4 interrupt test program
Recommended ReadingLatest update time:2024-11-15 14:56
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- How is the output V0 of this op amp derived?
- The LCD screen uses the ILI9325 screen controller, and the 32-bit board is STM32F103ZET6. After burning the program, only the background is lit,...
- About Negative Feedback Amplifier Circuit
- GD32E230C development platform is finally built
- Proteus MSP430 MCU simulation example 16 - timer timing 1 second
- Building ESP32-C3 development environment based on window Visual Studio Code: ESP-IDF
- [AT-START-F403A Review] + Unsuccessful W25Q128 Read and Write
- I don't know much about the commonly used domestic device manufacturers.
- Cadence Allegro beginners must read
- [Atria Development Board AT32F421 Review] 1. Unboxing and lighting