Today, I encountered a problem with the IARAVR interrupt service routine while debugging the program: this kind of pragma may not be used... I spent an hour debugging and found a problem that almost made me collapse.
Take the timer counter 0 interrupt service routine as an example:
#pragma vector=TIMER0_OVF_vect
_interrupt void Timer0(void)
{
. . . . .
. . . . . . .
}
I spent a long time debugging but didn't find any errors. When I looked at the official examples, I accidentally discovered that I needed to add two "underscores" before interrupt. Oh my god...
#pragma vector=TIMER0_OVF_vect
__interrupt void Timer0(void)
{
. . . . .
. . . . . . .
}
Comparing the two paragraphs above, especially when they are placed on two programs, although some differences can be seen, the length of the underline is generally considered to be due to display differences between different software, so it is considered to be the same underline. . .
Previous article:Why does AVR use write 1 as a means to clear the interrupt flag bit?
Next article:AVR MCU Series - Atmega8A Programming Introduction
- Popular Resources
- Popular amplifiers
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
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- 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
- 51. Detailed explanation of reset circuits for AVR, PIC, MSP430 and other microcontrollers
- Share: Capsule Robot Antenna Design Information (English)
- The award-winning live broadcast will start at 10:00 this morning: "Dadatong helps you unlock the new generation of ADAS technology"
- Free Pinouts eBook (The Pinouts Book) V0.3
- [ESK32-360 Review] 4. Run the virtual serial port routine
- 【TI recommended course】#Lecture on basic knowledge of electronic circuits#
- Low-pass filter waveform distortion problem
- Questions about PCB antenna
- [RVB2601 Creative Application Development] RVB2601 Hardware Part--1
- #Servo What is a servo?