Skip to main content
  • 产品
  • Software evaluation
  • 下载
  • Free utilities
  • 购买
  • 芯片厂商
  • 支持
  • 关于我们
  • Search
  • 工作机会
  • 新闻简报
  • 联系我们
  • embOS
  • Zero Interrupt Latency

    Zero interrupt latency

    embOS zero interrupt latency explained.

    Contact us
    Downloads
    Documentation
    SEGGER embOS

    What is interrupt latency?

    Interrupt latency is the time that passes between the occurrence of an interrupt request and the subsequent execution of the first instruction of the respective interrupt service routine. Every computer system involves interrupt latency, the duration of which depends on various factors and may differ even on the same computer system. The most interesting value is the worst case interrupt latency. The interrupt latency is a sum of a lot of different smaller delays explained below.
    This is important when critical code should be executed as soon as possible once an interrupt occurrs. For example, an emergency switch is intended to stop a machine at once, and the code in the respective interrupt routine will stop the machine. It is essential, and may be even life-threatening, if the interrupt service routine is delayed in doing so.

    Causes of Interrupt Latency

    • The first delay is typically caused by hardware: The interrupt request signal needs to be synchronized to the CPU clock. Depending on the synchronization logic, up to 3 CPU cycles may expire before the interrupt request has reached the CPU core.
    • The CPU will typically complete the current instruction, which may take several cycles. On most systems, divide, push-multiple or memory-copy instructions are the most time-consuming instructions to execute. On top of the cycles required by the CPU, additional cycles are often required for memory accesses. In an ARM7 system, the instruction STMDB SP!,{R0-R11,LR} typically is the worst case instruction, storing 13 register of 32-bit each to the stack, and takes 15 clock cycles to complete.
    • The memory system may require additional cycles for wait states.
    • After completion of the current instruction, the CPU performs a mode switch or pushes registers on the stack (typically PC and flag registers). Modern CPUs such as ARM generally perform a mode switch, which takes less CPU cycles than saving registers.
    • Pipeline fill: Most modern CPUs are pipelined. Execution of an instruction happens in various stages of the pipeline. An instruction is executed when it has reached its final stage of the pipeline. Since the mode switch has flushed the pipeline, a few extra cycles are required to refill the pipeline.
    • An RTOS also needs to temporarily disable the interrupts that could call API functions of the RTOS. Some RTOSes disable all interrupts, effectively worsening interrupt latency for all cases. Some other, including embOS, disable low-priority interrupts only and thus will not affect the latency of high-priority interrupts.

    Interrupt priorities

    Most CPUs support interrupts with different priorities. The exact amount of different levels of interrupt priorities depends on the CPU and the interrupt controller in use. Different priorities have two effects:

    • If different interrupts occur simultaneously, the interrupt with higher priority takes precedence and its ISR is executed first.
    • Interrupt execution can be intermitted by other interrupts of higher priority
    • The CPU interrupt level can be configured to a specific value, which disables all interrupts with a interrupt priority below this value.

    The solution: embOS zero interrupt latency

    Instead of disabling interrupts when embOS does atomic operations, the interrupt level of the CPU is set to a specific threshold. Therefore all interrupts with interrupt priorities higher than this threshold can still be processed. These interrupts are named zero latency interrupts. All interrupts with priority level below the threshold are disabled. These interrupts are named embOS interrupts.
    embOS will never add any latency to the zero latency interrupts. Therefore they will be executed as fast as without embOS. This makes it easy to use time critical interrupt service routines with embOS.

    • User manual
    • Online documentation
    • Knowledge Base
    • List of downloads
    • Release notes
    • Update notification
    • Pricing
    • Support
    • Silicon vendor resources

    全球总部

    德国: SEGGER Microcontroller GmbH

    地址: Ecolab-Allee 5
    40789 Monheim am Rhein, Germany
    电邮: info@segger.com
    电话: +49-2173-99312-0
    传真: +49-2173-99312-28

    网点分布

    中国:哲戈微系统科技(上海)有限公司

    地址: 中国上海市闵行区秀涟路133号
    大虹桥国际A 栋218室
    邮编201199
    电邮: china@segger.com
    电话: +86-133-619-907-60


    简易信息聚合

    通过ISO 9001认证

    ISO 9001

    30多年的嵌入式行业经验

    First-class embedded software tools since 1992
    • 版本说明
    • 免责声明
    • 行为准则
    • 隐私策略
    • 沪ICP备2022005181号
    • 沪公网安备 31011202014525号
    © 2026 SEGGER - 版权所有.

    您即将离开 segger.cn 而访问境外网站,是否继续?