STM8 interrupt sources

Publisher:BoldDreamerLatest update time:2020-07-09 Source: eefocusKeywords:STM8 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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).

  • STM8_interrupt processing flow
    (Figure 17: Interrupt processing flow chart)

  • 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.

STM8_dedicated interrupt instruction set
(Table 15: Dedicated interrupt instruction set)


Keywords:STM8 Reference address:STM8 interrupt sources

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

The difference between PWM1 and PWM2 in STM8
The PWM1 and PWM2 modes in STM8 are mandatory parameters for clock output PWM waveform control. The prototype of the library function is as follows: void TIMx_OC2Init(TIM2_OCMode_TypeDef TIM2_OCMode,                   TIM2_OutputState_TypeDef TIM2_OutputState,                   uint16_t TIM2_Pulse,                  
[Microcontroller]
STM8 PWM routines
In single-chip microcomputer application systems, PWM signal output is often used, such as motor speed control. They are also integrated with PWM function modules to facilitate user applications.       For PWM signals, there are two main concepts involved, one is the period or frequency of the PWM signal, and the oth
[Microcontroller]
Solution to the level output problem after STM8 turns off PWM output
If the PWM output of the STM series microcontroller is turned off, for example, by using TIM1_CtrlPWMOutputs to stop the output, the level is in an uncertain state. It depends on: 1. Characteristics of GPIO initialization 2. The level at the moment of shutdown 3.CCMR1 register settings   Therefore, to achieve output d
[Microcontroller]
STM8 simulated serial port program
1. Receiving The default data format of the serial port is a start bit + 8 data bits + stop bit. Since the start bit is low level, the stop bit is high level. Therefore, the RX line needs to enable external interrupts, and the interrupt mode is falling edge interrupt. You only need to enable the timer in the interru
[Microcontroller]
STM8 study notes---KEY
Use the button to control the LED light on and off. The button is connected to the PC4 port, and the LED light is connected to the PD4 port. The LED light is controlled by the high and low levels of the IO port, so for the LED, the IO port is the output port. The button is determined by the external circuit to determi
[Microcontroller]
STM8 study notes---KEY
STM8 learning summary 3: TIM1 timer usage
This article mainly summarizes the meaning of each statement when developing library functions of STM8. (1) TIM1 initialization configuration function The main function of the function is to set the parameters and working mode of the counter and enable it; void Tim1_Init(void) {   TIM1_TimeBaseInit(16,TIM1_COUNT
[Microcontroller]
STM8 IAP and APP
Recently, the project requires the development of an STM8 upgrade system, that is, upgrading the APP through IAP. MCU: STM8S207M8 (different models only need to modify the corresponding interface) IAP:bootloader v1.1(AN2659code) APP: Project Application Development environment: STVD+Cosmic Upgrade software:
[Microcontroller]
Explanation of IdMask mode of STM8 CAN bus
Preface In the CAN protocol, the identifier of the message does not represent the address of the node, but is related to the content of the message. Therefore, the sender sends the message to all receivers in the form of broadcast. When receiving the message, the node determines whether the software needs the message
[Microcontroller]
Explanation of IdMask mode of STM8 CAN bus
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号