在线免费观看成年人视频-在线免费观看国产-在线免费观看国产精品-在线免费观看黄网站-在线免费观看精品

產品分類

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

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

Real Time: Some Notes on Microcontroller Interrupt Latency

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

       
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

推薦產品

更多
人妻多毛丰满熟妇av无码| 日产乱码一二三区别视频 | 欧洲VODAFONEWIFI喷| 亚洲精品成人片在线观看精品 | 国产精品福利一区二区| 男人激烈吮乳吃奶动态图| 亚洲AV无码久久久久久精品同性| 草草影院精品一区二区三区| 久久天天躁狠狠躁夜夜AV浪潮| 性VODAFONEWIFI另类| 宝贝你下面喷潮了| 久久综合九色综合久99| 亚洲av网站在线| 妇女强高潮18ⅩXXX| 欧美日韩免费观看| 一本大道香蕉大L在线吗视频| 国产一区二区三区不卡在线观看| 三上悠亚SSNI452内衣模特| 99久久婷婷国产一区二区| 久久不卡国产精品无码| 无套内谢的新婚少妇国语播放| 被黑人猛男连续高潮视频| 男按摩师舌头伸进去了| 亚洲午夜无码极品久久| 好男人在线视频神马影视WWW| 天天躁日日躁狠狠躁欧美老妇小说 | 无码熟妇人妻AV在线影片最多| 菠萝蜜视频APP在线观看| 免费无码观看的AV在线播放 | 国产成人年无码AV片在线观看 | 在线观看4480私人影视| 娇妻当着我的面被4P| 午夜DJ在线观看免费完整版社区 | 少妇与子乱A级全毛片| エロドラえもんCOM中文在线| 男女一起差差差差差| 永久免费AⅤ无码网站在线观看| 精品黑人一区二区三区| 亚洲AV无码成H人动漫在线观看 | 色欲丰满熟妇人妻av一区二区| 亚洲精品国产成人| 国产精品毛片无码| 少妇人妻无码专区视频免费| 边做饭边被躁BD在线播放| 欧美无砖专区一中文字| 中文字日产幕码三区的做法步| 久久亚洲精品中文字幕| 亚洲婷婷五月综合狠狠| 精品国产成人亚洲午夜福利| 性欧美VIDEO高清| 国产日产欧洲系列| 五月丁香综合激情六月久久| 国产黄A三级三级三级| 丝袜老师办公室里做好紧好爽| 东北小伙二十厘米粗大硬| 日本三级韩国三级欧美三级| 被青梅竹马的学弟给锁定了林擎霄| 欧美日韩视频一区二区三区| 9色国产深夜内射| 欧美黑人XXXX高潮猛交| 99精品国产成人综合| 欧美大肚子孕妇疯狂作爱视频| 80岁老熟妇乱子伦牲交| 女人浓毛巨茎ⅩXXOOO| 99精品国产福利在线观看| 欧美午夜精品久久久久免费视| BT天堂新版中文在线| 亲孑伦视频一区二区三区视频| 啊灬啊灬啊灬快灬高潮少妇| 日本精品一区二区三区在线视频| 成人Av在线播放| 熟妇一区二区三区| 国产精品久久久久久吹潮| 午夜成人理论福利片| 国外精产品W灬源码16| 亚洲精品乱码久久久久久中文字幕 | 丰满少妇被猛烈进入高清播放| 少妇无码一区二区三区| 国产精品国产三级在线专区| 亚洲AⅤ天堂AV天堂无码APP| 妓女妓女影院妓女影库妓女网| 亚洲日韩激情无码一区| 老赵抱着媛媛在厨房做| 99久久国产福利自产拍| 日本50岁丰满熟妇XXXX| 国产白浆喷水在线视频| 无人区码一码二码三MBA| 黑人粗大与亚裔乱P视频| 亚洲熟妇色XXXXX高潮喷水| 麻豆高清免费国产一区| FREEFR性中国少妇性HD| 色老太BBWBBWBBW高潮| 国产乱子伦精品无码专区| 亚洲精品AAA揭晓| 老熟妇午夜毛片一区二区三区| 99久久国产综合精品麻豆| 日本丰满熟妇多毛| 国产AV一区二区三区最新精品| 亚洲av网站在线观看| 久久久久久精品免费免费SSS| 2021精品久久久久精品免费网| 人体艺术在线观看| 国产妓女牲交A毛片| 亚洲精品国自产拍在线观看| 美女扒开内裤无遮挡| 把腿张开我要CAO死你在线观看 | 成人精品视频一区二区三区不卡| 天堂岛最新版在线BT天堂| 黄又色又污又爽又高潮动态图| 约附近的寂寞妇女| 人妻熟妇女的欲乱系列| 国产精品一区二区久久国产| 亚洲一区二区三区AV无码| 欧美亚洲色综久久精品国产| 国产成人乱色伦区| 亚洲人成网站18禁止影院| 欧美成人精品高清在线观看| 国产成人片AⅤ在线观看 | 免费无码又爽又刺激毛片| 成年女人A毛片免费视频| 午夜精品一区二区三区在线观看| 九九视频免费精品视频| JIZZJIZZ日本护士| 午夜DJ在线观看免费完整版社区| 久久无码中文字幕免费影院| 爸爸入狱以后妈妈双人桥小权| 无人区码二码三码四码区别| 久久亚洲日韩AV一区二区三区| 波多野42部无码喷潮在线| 无码一区二区三区老色鬼| 久久丫精品国产亚洲AV| 成人免费无码A毛片| 亚洲第一最快AV网站| 欧美熟妇另类久久久久久不卡| 国产精品免费AⅤ片在线观看 | 狠狠色欧美亚洲综合色| 99精品又大又爽又粗少妇毛片| 玩肥熟老妇BBWXXX视频| 久久综合九色综合久99| 公交车后车座的疯狂的做| 亚洲熟女WWW一区二区三区| 日本大肚子孕妇交XXX| 狠狠噜天天噜日日噜视频跳一跳 | 嗯~啊哈好深好骚啊哼| 亚洲精品无码av中文字幕电影网站| 欧美人和黑人牲交网站上线| 国产精品无码无片在线观看3D| 中文字幕一区二区三区久久网站 | 亚洲高清国产AV拍精品青青草原| 欧美日韩国产精品自在自线| 国产欧美久久一区二区| ASSPICS亚洲美女裸体CH| 亚洲Aⅴ无码专区在线观看q| 欧美极品性饥渴少妇大战黑人| 国产熟女老妇300部MP4| AV鲁丝一区鲁丝二区鲁丝三区| 亚洲AV成人无码网天堂| 全部免费毛片在线播放| 精品国产一区二区三区麻豆| 成码无人AV片在线观看网站| 亚洲一区二区三区AV无码| 双腿扒开调教羞辱惩罚视频| 乱色熟女综合一区二区三区| 国产精品视频一区国模私拍| 99久久精品费精品国产| 亚洲国产精品一区二区制服| 日本极品白嫩ASSPICS| 久久精品人妻中文系列葵司| 在线观看成人片韩剧| 无码18在线网站成人网站| 女BBBB槡BBBB槡BBBB| 狠狠躁夜夜躁人人爽天天| 成人免费视频无码专区| 杂乱小说2第400部| 性饥渴老头XXXXⅩHD| 日おめでとうございます| 久久久久亚洲AV无码专区首页网| 99久久综合狠狠综合久久止| 性色AV无码专区亚洲AV毛片子| 欧美午夜性春猛交XXX| 久爱无码免费视频在线| 国产成人亚洲综合无码8| 18禁美女裸体无遮挡免费观看国| 亚洲AV无码潮喷在线观看蜜桃| 日韩人妻无码一区二区三区综合部| 久青草无码视频在线观看| 国产人成无码视频在线| 成人欧美一区二区三区黑人免 | FREESEX欧美喷水| 亚洲午夜福利AV一区二区无码| 无码精品人妻一区二区三区涩爱 | 四虎国产成人永久精品免费| 男男激情H视频Gay片GV| 精品国产一区二区三区麻豆 | 亚洲夜夜性无码国产盗摄| 无码YY4800亚洲私人影院| 人妻丰满熟妇av无码区免费蜜臀| 麻花豆传媒剧国产MV入口| 加勒比久久综合久久鬼色88| 国产成人无码精品久久久免费|