Writing method 1:
The interrupt function specifies the interrupt vector number:
main.c
#pragma CODE_SEG __NEAR_SEG NON_BANKED
interrupt interrupt vector number void interrupt service function name (void) {
//Interrupt service routine code segment
}
#pragma CODE_SEG DEFAULT
The interrupt vector number is defined in the mc9s12g128.h file, such as:
/**************** interrupt vector numbers ****************/
#define VectorNumber_Vportj 24U
Writing method 2:
Modify the prm file and declare the interrupt function in the Project.prm file:
main.c:
#pragma CODE_SEG __NEAR_SEG NON_BANKED
interrupt void interrupt service function name (void) {
//Interrupt service routine code segment
}
#pragma CODE_SEG DEFAULT
Project.prm:
Add VECTOR ADDRESS interrupt vector interrupt service function name at the end of the file
For example: ProtJ interrupt vector: 0xFFCE, interrupt function name: PTJ_IRQ
VECTOR ADDRESS 0xFFCE PTJ_IRQ
The interrupt vector is defined in the mc9s12g128.h file, such as:
/**************** interrupt vector table ****************/
#define Vportj 0xFFCEU
Previous article:Freescale MC9S12G128 GPIO
Next article:Freescale MC9S12G128 microcontroller overview
- Popular Resources
- Popular amplifiers
- 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
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- I plan to equip the slag EBAZ4205 with an extended version
- TMC5130 is used as a driver to drive the motor. Why does the motor hum when it is stationary?
- Live broadcast at 10 am today [TI's optimized solutions in industrial multi-protocol communication applications]
- Made an LED music spectrum analyzer
- EEWORLD University Hall----TI Smart Speaker and Sound Bar- New Power Design Trend
- What parameters should be paid attention to when selecting optocouplers?
- Is there any difference between bit rate and airspeed?
- TFT LCD display realizes dial pointer clock
- Power conversion module 220V to 18V
- About DSP28335 SPI transmission