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

產品分類

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

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

Real Time: Some Notes on Microcontroller Interrupt Latency

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

       
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综合色区无码一区爱AV| 无码日韩人妻AV一区二区三区 | 国产交换配乱婬视频| 国产精品亚洲综合网熟女| 久久精品国产亚洲精品| 欧美特级特黄AAAAAA在线看| 天堂中文在线最新版WWW| 亚洲日韩欧美一区久久久久我| 自拍偷自拍亚洲精品情侣| 成人无码区免费AⅤ片WWW软件| 国产微拍精品一区二区| 久久亚洲精品成人无码网站夜色| 人妻丰满熟妇av无码区HD| 性孕交大肚子孕妇| 最新欧美精品一区二区三区| 粉嫩小泬无遮挡久久久久久| 精品人妻少妇一区二区三区| 欧美无人区码卡二卡3卡4乱码| 铜铜铜铜铜铜铜好多疼| 一二三四视频社区| 夫妇交换聚会群4P疯狂大战视频| 精品少妇一区二区| 人妻中出受孕 中文字幕在线| 小12箩利洗澡无码视频网站| 中文字幕久精品免费视频| 国产AV日韩A∨亚洲AV电影| 久久久久久久极品内射| 撒尿BBWBBW毛| 亚洲最大无码成人网站4438| 大乱东京道一本热大交乱| 久久国产自偷自偷免费一区调| 人人澡人人妻人人爽人人蜜桃麻豆| 亚洲AV高清在线一区二区三区| 91久人人做人人妻人人玩精品| 国产精品日本亚洲欧美| 女人被狂躁c到高潮视频| 亚精区在二线三线区别99| 999国内精品永久免费观看| 国产美熟女乱又伦AV果冻传媒| 美女扒开尿口让男人桶| 午夜精品久久久久9999高清| 99精品国产福利在线观看| 国外AV无码精品国产精品| 日本ⅩXXX色视频在线观看| 亚洲日韩精品一区二区三区| 丰满少妇被猛烈进入| 老熟女HDXX中国老熟女| 午夜18禁自慰JK爆乳网站| VPSWINDOWS另类精品| 精品无人区麻豆乱码无限制| 少妇人妻88久久中文字幕| 做AJ的姿势教程大全图片高清版| 国产亚洲AV人片在线观看| 人人妻人人做人人爽| 亚洲少妇一区二区视频| 国产精品成人一区二区三区| 欧美无遮挡很黄裸交视频| 亚洲无码成人av| 国产福利在线永久视频| 欧美性大战久久久久久| 亚洲午夜性春猛交77777 | 无人区免费一二三四乱码| HD2LINODE日本成熟IP| 久久精品饰品有限公司网站| 无码AV一区二区三区不卡| YELLOW高清免费观看日本| 久久久国产精品无码免费专区| 无码熟熟妇丰满人妻啪啪| 波多野结衣人妻女教师4| 麻豆丰满少妇CHINESE| 亚洲插肏熟女人妇的屄网址| 国产成人久久AV免费| 人妻丰满熟妇AⅤ无码| 制服在线无码专区| 激情男女高潮射精AV免费| 玩弄CHANEL妇熟女| 成人欧美一区二区三区黑人| 男朋友把舌头都伸进我的嘴巴里了| 亚洲精品舔Av一| 国产乱子伦视频一区二区三区| 日日狠狠久久偷偷色综合96| AV在线亚洲男人的天堂| 开心久久婷婷综合中文字幕| 亚洲国产精品无码久久久动漫| 国产A在亚洲线播放| 日产精品一卡2卡三卡4卡乱码| 91人妻人人揉人人躁人人 | 野兽的夜晚第四季忘不掉的前任| 国产亚洲欧美精品一区| 天天躁夜夜躁很很躁| 成熟丰满熟妇高潮XXXXX视频| 欧美多人乱大交XXXXX变态亚| 在线观看AV黄网站永久| 久久精品日日躁夜夜躁欧美| 亚洲国产精品久久久天堂麻豆宅男| 国产精品亚洲欧美大片在线观看 | 亚洲国产精品久久久久网站| 国产美女在线精品免费观看| 无码精品人妻 中文字幕| 国产成人AV一区二区三区在线观| 日本一本免费一区二区三区免| JIZZJIZZ免费看国产| 欧美A级毛欧美1级A大片式放| 在线观看国产一区二区三区| 久久久无码精品亚洲日韩蜜臀浪潮| 亚洲另类激情综合偷自拍图| 护士HD老师FREE性ⅩⅩⅩ| 亚洲AV午夜成人片忘忧草在线| 国产男男Gay视频在线看| 无码人妻品一区二区三区精99| 国产成A人亚洲精V品无码性色| 色欲AV蜜臀AV一区在线| 刺激交换经历过程小说| 色又黄又爽18禁免费网站| 豆国产93在线 | 亚洲| 色噜噜噜狠狠色一色伊人蜜桃| 粗大在少妇体内进进出出| 少妇扒开粉嫩小泬视频| 国产AⅤ爽AV久久久久成| 少妇伦子伦精品无码STYLES| 豆国产97在线 | 韩国| 手在线播放波多野结衣| 国产成人久久AV免费| 无码中文字幕日韩专区| 国产在线精品一区二区三区直播| 亚洲AV无码一区二区二三区3p | 亚洲清清爽爽AABB| 久久精品免费观看国产| 一本大道东京热无码AⅤ| 美女露内裤扒开腿让男人桶无遮挡 | 久久久亚洲熟妇熟女ⅩXXX直播| 一本色道久久综合亚洲精品 | 韩国全部三级伦在线播放| 亚洲AV永久无无码精品一区二区 | 国产一区在线观看二区| 午夜精品久久久久久久99热| 国偷自产AⅤ一区二区三区 | 午夜DJ在线观看免费完整版社区 | 又硬又粗又大一区二区三区视频| 噜噜狠狠色综合久色AⅤ网址| 7777色情ⅩXXX欧美色妇| 人C交Z〇○Z〇○ⅩⅩ| 国产Chinese男男GayGay网站 | 熟女亚洲综合精品伊人久久| 国产精品嫩草影院一二三区入口| 亚洲AV无码成人YELLOW| 久久国产劲爆∧V内射| 中文字幕成熟丰满人妻| 人妻激情偷乱视频一区二区三区 | 公交车舒婷1一20全文| 亚州日本乱码一区二区三区| 久久国产精品99国产精| 97精品一区二区视频在线观看| 日本熟妇人妻XXXXX野外呻| 国产精品欧美一区二区三区| 亚洲国产成人AⅤ毛片奶水| 两个男用舌头到我的蕊花 | 人人爽亚洲AⅤ人人爽AV人人片| 丰满人妻被粗大爽ⅩXOO| 亚洲AV毛茸茸av成熟女人| 狼友AV永久网站在线观看| 啊灬啊灬啊灬快灬深视频无遮掩| 偷拍 拍自 欧美色区| 精品无码乱码AV| AV无码东京热亚洲男人的天堂| 少妇高潮惨叫久久久久久| 狠狠综合久久久久尤物丿| 42岁女子20天断崖式衰老| 熟妇人妻不卡中文字幕| 精品人妻系列无码一区二区三区| 69国产成人精品午夜福中文| 天黑黑影院在线观看免费中文 | 精品国产你懂的在线观看| 最新国产精品亚洲| 天堂А√在线最新版中文下载| 精品久久久久久无码人妻蜜桃| A∨无码天堂AV| 无码人妻巨屁股系列大又挺拔| 久久亚洲AV成人无码国产电影| 边吃奶边扎下面动态| 亚洲AV无码久久精品色欲| 女同学浮乱系列合集| 国产精品香蕉成人网在线观看| 一本无码人妻在中文字幕免费| 日韩欧美群交P片內射中文| 精产国品一二三产区区别在哪儿 | 国产自产V一区二区三区C| 18禁亲胸揉胸膜下刺激免费网站| 色婷婷综合久久久中文字幕| 久久99国产精品久久99| 波多野结衣50连登视频| 亚洲精品成人无码| 人妻无码熟妇乱又视频 | 亚洲精品国产欧美一二区| 欧美综合自拍亚洲图久青草| 国产在线精品无码二区| ASS十三小美女ASSPICS| 亚洲AV噜噜在线成人网站| 欧洲码和亚洲码的尺码区别| 国产亚洲精久久久久久无码蜜桃|