5502可屏蔽中断处理流程

StepDescription
Interrupt request sent to CPUThe CPU receives a maskable interrupt request.
Set corresponding IFR flagWhen the CPU detects a valid maskable interrupt request, it sets and latches the corresponding flag in one of the interrupt flag registers (IFR0 or IFR1). This flag stays latched until the interrupt is acknowledged or until the flag is cleared by software or by a DSP hardware reset. (See the description of IFR0 and IFR1 in section 2.8.2.)
Interrupt enabled in IER?The CPU cannot acknowledge the interrupt unless the corresponding enable bit is 1 in one of the interrupt enable registers (IER0 or IER1). (See the description of IER0 and IER1 in section 2.8.3.)
INTM = 0?The CPU cannot acknowledge the interrupt unless the interrupt mode bit (INTM) is 0. That is, interrupts must be globally enabled. (See the description of INTM in section 2.10.2.8.
Branch to interrupt service routineThe CPU follows the interrupt vector to the interrupt service routine. While branching, the CPU performs the following actions: It completes instructions that have already made it to the decode phase of the pipeline. Other instructions are flushed from the pipeline. It clears the corresponding flag in IFR0 or IFR1, to indicate that the interrupt has been acknowledged. It saves certain registers values automatically, to record important mode and status information about the interrupted program sequence (see the description of automatic context switching in section 4.4). It creates a fresh context for the ISR by forcing INTM = 1 (globally disables interrupts), DBGM = 1 (disables debug events), and EALLOW = 0 (disables access to non-CPU emulation registers)
Execute interrupt service routineThe CPU executes the interrupt service routine (ISR) that you have written for the acknowledged interrupt. Some registers values were saved automatically during the branch to the ISR. A return-from-interrupt instruction at the end of your ISR forces an automatic context restore operation (see the description of automatic context switching in section 4.4) to restore these register values. If the ISR shares other registers with the interrupted program sequence, the ISR must save other register values at the beginning of the ISR and restore these values before returning to the interrupted program sequence
Program continuesIf the interrupt request is not properly enabled, the CPU ignores the request, and the program continues uninterrupted. If the interrupt is properly enabled, its interrupt service routine is executed, and then the program continues from the point where it was interrupted.

转载于:https://www.cnblogs.com/elaron/archive/2011/07/21/2112982.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值