STM8 interrupt sources
The STM8 interrupt controller handles 2 types of interrupt sources:
Non-maskable interrupts: RESET, TLI, and TRAP
Maskable interrupt: External interrupt or embedded peripheral interrupt
Non-maskable interrupt source
Non-maskable interrupt does not consider the status of I1 and I0 of CC register (see Figure 17). Only when TRAP interrupt occurs, the
contents of PC, X, Y, A and CC registers are pushed onto the stack. The corresponding vector is loaded into PC register and I1 and I0 bits are set to disable interrupt (3 levels of priority).TRAP (non-maskable software interrupt)
responds to software interrupt when TRAP instruction is executed. Its response process is shown in the flowchart of Figure 17.
TRAP interrupt cannot cause the processor to exit from Halt mode.RESET
Reset interrupt is the highest priority of STM8 software and hardware interrupts, which means that all interrupts are disabled at the beginning of the reset procedure. They must be enabled by the RIM instruction (see Table 15).
Reset interrupt can exit the processor from Halt mode.
For more detailed reset interrupt management, see the reset chapter.The highest level hardware interrupt of TLI
will generate a hardware interrupt when a specific I/O edge is detected on the corresponding TLI input.
Note: The TRAP instruction is prohibited in the TLI interrupt service routine.
Maskable interrupt sources
For maskable interrupts, if the corresponding interrupt is enabled, and if the interrupt priority in the ITC_SPRx register is higher than the priority of the currently executing interrupt (according to the I1 and I0 bits of the CC register), it can be responded to. If any of the above 2 conditions is not met, the interrupt will be latched and kept in the waiting state.External interrupts
can be used to wake up the MCU from Halt mode. The selection of external interrupt triggering mode can be achieved by software writing to the external interrupt control register (EXTI_CRx).
When multiple external pin interrupts connected to the same interrupt vector are selected at the same time, they are in a 'logical or' relationship.
When the external level-triggered interrupt is latched, if the given level is maintained until the end of the interrupt subroutine, the level signal will trigger the interrupt again, unless the interrupt is disabled in the interrupt subroutine.Peripheral interrupts
Most peripheral interrupts will cause the MCU to wake up from Halt mode.
A peripheral interrupt is generated when the interrupt flag bit of the corresponding peripheral status register is set and the enable bit of the corresponding peripheral control register is set. The
standard sequence for clearing an STM8 peripheral interrupt is to read or write the relevant registers after accessing the status register.
When a clearing process is executed, the corresponding pending interrupt (an interrupt that will be executed) will be lost.
(Figure 17: Interrupt processing flow chart)
(Table 15: Dedicated interrupt instruction set)
Previous article:STM8 simultaneous and nested interrupt management
Next article:STM8 interrupt masking and processing flow
Recommended ReadingLatest update time:2024-11-16 18:09
- Popular Resources
- Popular amplifiers
- STM8 C language programming (1) - basic program and startup code analysis
- Description of the BLDC back-EMF sampling method based on the STM8 official library
- STM32 MCU project example: Smart watch design based on TouchGFX (8) Associating the underlying driver with the UI
- uCOS-III Kernel Implementation and Application Development Practical Guide - Based on STM32 (Wildfire)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Qiming Cloud Sharing | What are the differences between Espressif's newly released ESP32-C2 and the ESP32-C3 that went into mass production in May this year?
- TrueStudio flashes STM32 project and prompts Verify failed, and now I am helpless
- Dynamic Near Field Communication (NFC) Type 4B Tag
- [GD32E231 Work Submission] Environmental Radiation Dose Monitoring Equipment Design
- [RVB2601 Creative Application Development] 7. IoT Control
- DM6446 DSP end program optimization
- MPXV2202DP connected to IN132 output abnormality, I don't know how to deal with it
- CES 2021 Complement Event Activity Recognition on IMU with Machine Learning Core
- Tektronix Prize-giving Event | Popular Applications of Semiconductor Materials and Device Test Technology
- Internet of Things vs Industrial Internet of Things: 10 Differences That Matter