美女网站一区二区_在线观看日韩毛片_成人在线视频首页_欧美精品一区二区三区久久久_国产精品亚洲一区二区三区在线_日本免费新一区视频_日本美女一区二区三区_精品亚洲成a人_久久不见久久见免费视频1_91首页免费视频_欧美一区二区在线看_91精品91久久久中77777_天堂蜜桃一区二区三区_av在线一区二区_欧美不卡一区二区_欧美影视一区二区三区

產品分類

當前位置: 首頁 > 工業電子產品 > 其他電子產品 > SoM

類型分類:
科普知識
數據分類:
SoM

Real Time: Some Notes on Microcontroller Interrupt Latency

發布日期:2022-10-09 點擊率:224

       
Interrupts take a lot out of a high-speed processor, especially one that is heavily pipelined and, capable of issuing more than one instruction per cycle. There could be eight to ten instructions in flight at any one time that either have to be run to completion, or annulled and restarted once normal execution resumes.

The electrical engineer needs to check that the interrupt responds fast enough for the application and, that the overhead of the interrupt does not swamp the main application.

Just how fast can a given MCU perform an interrupt? That is certainly affected by the application, but it seems unreasonably hard to find a number for this item.

When an interrupt occurs, the CPU saves some of its registers and executes the interrupt service routine (ISR), and then returns to the highest-priority task in the ready state. Interrupts are usually maskable and nestable.

Just to be clear, latency is usually specified as the time between the interrupt request and execution of the first instruction in the interrupt service routine. However the "real latency" must include some housekeeping that must be done in the ISR, which can cause confusion.

The value in which an electrical engineer is usually interested is the worst -case interrupt latency. This is a sum of many different smaller delays.

  1. The interrupt request signal needs to be synchronized to the CPU clock. Depending on the synchronization logic, typically up to three CPU cycles can be lost before the interrupt request has reached the CPU core.

  2. The CPU will typically complete the current instruction. This instruction can take a lot of cycles, with divide, push-multiple, or memory-copy instructions requiring most clock cycles taking the most time. There are often additional cycles required for memory access. In an ARM7 system, for example, the instruction STMDB SP!,{R0-R11,LR} (Push parameters and perm.) Registers is typically the worst case instruction. It stores 13 32-bit registers on the stack and requires 15 clock cycles.

  3. The memory system may require additional cycles for wait states.

  4. After completion of the current instruction, the CPU performs a mode switch or pushes registers (typically PC and flag registers) on the stack. In general, modern CPUs (such as ARM) perform a mode switch, which requires less CPU cycles than saving registers.

  5. If your CPU is pipelined, the mode switch has flushed the pipeline and a few more cycles are required to refill it. But we are not done yet. In more complex systems, there can be additional causes for interrupt latencies.


In more complex systems, there can be additional cause for interrupt latencies.

  1. Latencies cause by cache line fill:
    If the memory system has one or multiple caches, these may not contain the required data. Then, not only the required data is loaded from memory, but in many cases a complete line fill needs to be performed, reading multiple words from memory.

  2. Latencies caused by cache write back:
    A cache miss may cause a line to replaced. If this line is marked as dirty, it needs to be written back to main memory, causing an additional delay.

  3. Latencies caused by Memory Management Units (MMU) translation table walks:
    Translation table walks can take a considerable amount of time, especially as they involve potentially slow main memory accesses. In real-time interrupt handlers, translation table walks caused by the Translation Lookaside Buffer (TLB) not containing translations for the handler and/or the data it accesses can increase interrupt latency significantly.

  4. Latencies caused by the application program:
    The application program can cause additional latencies by disabling interrupts.

  5. Latencies caused by interrupt routines:
    If the application has more than one urgent interrupt, they cannot be masked off so another may be requested, lengthening the total time.

  6. Latencies caused by the RTOS:
    A RTOS also needs to temporarily disable the interrupts which can call API-functions. Some RTOSs disable all interrupts, effectively worsening interrupt latencies for all interrupts, some (like embOS from Segger) disable only low-priority interrupts.


ARM7 and ARM Cortex

The ARM7 and ARM Cortex are very different in the interrupt area. By integrating the interrupt controller in the processor, Cortex-M3 processor-based microcontrollers have one interrupt vector entry and interrupt handler per interrupt source. This avoids the need for re-entrant interrupt handlers, which have a negative effect on interrupt latency.

 ARM7TDMICortex-M3
Interrupt controllerExternal to processorIntegrated nested vectored interrupt controller
Interrupt handlersOne fast (nFIQ) and one slow (nIRQ)One handler per interrupt source
RTOS system timerUses one timer of the microcontrollerUses integrated "SysTick" timer on the processor
System callsSWI instruction (interrupts disabled)SVC instruction (interrupts enabled)
Memory interfaceSingle interface, data read/write takes 3 cyclesSeparate instruction and data bus interfaces, single cycle data read/write
PipelineThree-stageThree-stage with branch speculation
Bit manipulationRead, modify, writeSingle instruction

The Cortex-M3 also accelerates the execution of interrupt handlers with logic to automatically save its general purpose and status registers in the stack when an interrupt arrives. The M3 is made even more efficient, in certain circumstances, by tail-chaining interrupts that arrive at the same time, as shown in Figure 1.

The interrupt latency is up to 12 cycles for the Cortex-M3 processor-based MCU, and the context switch time is<4 μs, while the ARM7 is <7 μs.

Tail-chaining

Figure 1: Tail-chaining on Cortex-M3 processor speeds up things.


Microchip

According to Keith Curtis, technical staff engineer at Microchip, the 8-bit PIC-16/PIC-18 MCUs take 12 to 20 clock cycles to get to the ISR — depending on the type of instruction that was in progress at interrupt time. Then, in the ISR, the compiler will add instructions to determine where the interrupt originated and to push some registers. If you are using assembly language, you would put in your own items that need pushing, perhaps none.

Microchip's 32-bit PIC32 MCUs, according to Adrian Aur, applications engineer, will take a maximum of 11 clock cycles to get to the ISR where you will save at least some registers — worst case, all 32 of them need one clock cycle each. If you are responding to INT7, the highest priority (and not interruptible), a set of shadow registers will be used, making response much faster. Then, the RTOS may want to make a thread change, or enable nested interrupts when running at lower priority levels, which will add some latency. Other than that, you should be fine

Atmel

In 2008, Electronic Products Magazine gave Atmel a Product of the Year Award for the AVR XMEGA microcontroller family. The biggest reason for that was its innovative eight-channel event system which enables inter-peripheral communication without CPU or DMA usage using a bus separate from the data bus. The benefit of this is predictable, low-latency, inter-peripheral signal communication, reduced CPU usage, and the freeing of interrupt resources.

Independent of the CPU and DMA, the response time for the event system will never be more than two clock cycles of the I/O clock (usually 62.5 ns).

The XMEGA uses a Harvard architecture with the program memory separate from data. Program memory is accessed with single level pipelining. While one instruction is being executed, the next is prefetched. Performance is enhanced with the fast-access RISC register file — 32 x 8-bit general-purpose working registers. Within one single clock cycle, XMEGA can feed two arbitrary registers from the register file to the ALU, do a requested operation, and write back the result to an arbitrary register.

The interrupt response time for all the enabled interrupts is a minimum of five CPU clock cycles. During these five clock cycles, the program counter is pushed on the stack. After five clock cycles, the program vector for the interrupt is executed. The jump to the interrupt handler takes three clock cycles.

If an interrupt occurs during execution of a multicycle instruction, this instruction is completed before the interrupt is served. If an interrupt occurs when the device is in sleep mode, the interrupt execution response time is increased by five clock cycles. In addition, the response time is increased by the start-up time from the selected sleep mode.

A return from an interrupt-handling routine takes five clock cycles. During these five clock cycles, the program counter is popped from the stack and the stack pointer is incremented.

下一篇: PLC、DCS、FCS三大控

上一篇: Low-Power, Long Rang

推薦產品

更多
美女网站一区二区_在线观看日韩毛片_成人在线视频首页_欧美精品一区二区三区久久久_国产精品亚洲一区二区三区在线_日本免费新一区视频_日本美女一区二区三区_精品亚洲成a人_久久不见久久见免费视频1_91首页免费视频_欧美一区二区在线看_91精品91久久久中77777_天堂蜜桃一区二区三区_av在线一区二区_欧美不卡一区二区_欧美影视一区二区三区


        91久久免费观看| 99久久精品无码一区二区毛片| 中文字幕在线不卡国产视频| 久久日韩粉嫩一区二区三区| 精品国产三级a在线观看| 欧美一级欧美一级在线播放| 欧美精品1区2区| 日韩免费高清电影| 国产视频一区二区在线观看| 国产精品国产自产拍在线| 亚洲精品免费看| 日本人妖一区二区| 久久99在线观看| 97久久精品人人做人人爽 | 日本不卡一二三区黄网| 另类小说视频一区二区| 国产精品原创巨作av| 99久久er热在这里只有精品66| 99高清视频有精品视频| 久久精品综合一区| 日本乱人伦一区| 日韩一区二区高清| 国产精品丝袜黑色高跟| 午夜精品福利一区二区蜜股av| 激情图区综合网| 91手机在线播放| 亚洲狠狠婷婷综合久久久| 欧美日韩一卡二卡| 国产亚洲污的网站| 亚洲大尺度视频在线观看| 国产一区二区在线电影| 成人免费91在线看| 亚洲精品一品区二品区三品区| 欧美日韩日日摸| 欧美国产日韩亚洲一区| 青青草原综合久久大伊人精品| 高清久久久久久| 欧美一区二区视频在线| 制服丝袜亚洲色图| 亚洲欧美电影院| 国产精品一区二区免费不卡| 国产精品区二区三区日本| 91福利视频在线| 日本一区二区动态图| 免费观看在线综合| 粉嫩av一区二区三区免费观看| 一区精品视频| 国产婷婷精品av在线| 日韩国产欧美三级| 国产传媒一区二区| 在线综合视频播放| 亚洲福利一二三区| yellow视频在线观看一区二区| 日本乱人伦一区| 亚洲色图欧洲色图| 风间由美一区二区三区在线观看| 欧美日韩亚洲一区二区三区在线观看 | 奇米精品一区二区三区在线观看一| 成人黄色在线视频| 色综合色狠狠综合色| 欧美韩国日本一区| 国产精品一线二线三线精华| 欧美一级二级三级| 久久久www成人免费毛片麻豆| 日韩黄色片在线观看| 久久国产精品久久精品国产| 欧美一级免费大片| 免费日韩伦理电影| 日韩成人av网站| 国产精品久久久久毛片软件| 国产福利91精品一区二区三区| 亚洲最新在线| 亚洲精品国产成人久久av盗摄| 97se亚洲国产综合自在线观| 欧美日本精品一区二区三区| 午夜精品aaa| 免费h精品视频在线播放| 久久伊人蜜桃av一区二区| 国产一区二区三区四区五区美女| 亚洲三区在线| 亚洲精品第1页| 国产欧美日韩一区| 国产亚洲一区二区三区四区| 成人免费高清在线观看| 欧美一区二区福利在线| 韩国av一区二区三区四区| 一区二区三区在线视频111| 一区二区三区国产精华| 国产一区免费观看| 中文字幕的久久| 91青青草免费观看| 久久久不卡影院| 91婷婷韩国欧美一区二区| 日韩女优制服丝袜电影| 国产69精品久久久久777| 日韩一级二级三级| 国产91丝袜在线18| 日韩欧美一级片| 成人小视频免费观看| 欧美一区二区免费视频| 国产精品77777| 日韩视频中午一区| 成人av在线一区二区三区| 欧美一区二区三区色| 国产成人亚洲综合色影视| 91精品国产色综合久久| 国产成人免费在线观看不卡| 欧美一区永久视频免费观看| 成人少妇影院yyyy| 久久综合色播五月| 国产一区二区精品免费| 一区二区三区四区在线| 午夜精品福利一区二区| 午夜激情一区二区三区| 欧美在线|欧美| 韩国精品在线观看| 精品国产乱码久久| av在线不卡观看| 亚洲欧美激情在线| 色综合中文综合网| 国产v综合v亚洲欧| 日韩精品一区二区三区四区视频| www.性欧美| 国产精品久久久久永久免费观看 | 亚洲欧洲99久久| 欧美极品一区二区| 日韩国产欧美三级| 91精品国产丝袜白色高跟鞋| 97人人澡人人爽| 自拍偷拍国产亚洲| 综合久久国产| 大胆欧美人体老妇| 国产精品美女久久久久久久网站| 免费国产一区| 久久99精品久久久久久动态图| 日韩精品最新网址| 久久影院理伦片| 强制捆绑调教一区二区| 精品久久久久久久久久久久包黑料| 成人蜜桃视频| 日本免费在线视频不卡一不卡二| 91超碰这里只有精品国产| 97人摸人人澡人人人超一碰| 亚洲国产日韩精品| 欧美日韩电影一区| 国产精品午夜av在线| 日本三级韩国三级欧美三级| 久久久久久久久岛国免费| 欧美日韩高清在线一区| 国模套图日韩精品一区二区| 中文字幕精品—区二区四季| 色噜噜狠狠一区二区三区果冻| 99re热这里只有精品视频| 亚洲成人777| 久久综合九色综合97_久久久| 蜜桃视频在线观看成人| 国产精品一区三区| 亚洲精品欧美二区三区中文字幕| 欧美日韩一二三| 欧美黄色直播| av一区二区久久| 免费成人美女在线观看| 国产精品免费人成网站| 欧美日韩视频在线第一区 | 精品国产乱码久久久久| 久久 天天综合| 中文字幕制服丝袜一区二区三区 | 久久精品日韩| 国产伦精品一区二区三区免费迷| 国产精品色呦呦| 欧美一区永久视频免费观看| 日韩三级电影免费观看| 99久久精品久久久久久清纯| 日韩成人一级片| 国产精品超碰97尤物18| 7777精品伊人久久久大香线蕉超级流畅| 久久婷婷开心| 91色在线porny| 国产一区二区三区蝌蚪| 午夜视黄欧洲亚洲| 国产精品久线在线观看| 日韩欧美亚洲另类制服综合在线| 亚洲欧洲日韩精品| 精品一区二区国产| 91九色在线观看| 成人午夜在线播放| 另类的小说在线视频另类成人小视频在线 | 欧美在线小视频| 日本日本精品二区免费| 国产v亚洲v天堂无码| 成人国产在线观看| 久久99国产乱子伦精品免费| 亚洲午夜精品17c| 亚洲天堂成人网| 亚洲国产成人自拍| 久久九九久久九九| 欧美v国产在线一区二区三区| 精品视频在线看| 在线观看视频一区| 一本色道a无线码一区v|