M0最高优先级的中断设计

本文介绍了M0处理器中最高优先级的两种中断:Reset和NMI。Reset中断通常置于最高优先级,但在某些场景下可能有局限性。NMI是非屏蔽中断,无法被禁用,常用于工业控制和汽车系统的安全性保障,如电源异常或看门狗功能。Hard fault则是处理执行期间的故障条件,如未知指令、总线错误或非法操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1  Reset                   -3            (Highest) Reset

绝大部分处理器设计时,将复位中断放在最高优先级。

一般来说这样设计是合理的,个人认为在某些应用场景这样处理仍有局限性。



2  NMI                      -2             Nonmaskable interrupt

The NMI is similar to IRQ, but it cannot be disabled and has the highest priority apart from the
reset. It is very useful for safety critical systems like industrial control or automotive.
Depending on the design of the microcontroller, the NMI could be used for power failure
handling, or it can be connected to a watchdog unit to restart a system if the system stopped
responding. Because the NMI cannot be disabled by control registers, the responsiveness is
guaranteed.

官方描述NMI是为了在工控和车控产品领域,专为提高安全性的设计。

也就是说安全第一:把安全性放在最高优先级处理,除了复位以外,不准许任何其他中断能够打断安全处理程序。

通常设计处理是:电源异常处理,连接看门狗去复位系统

 



3  Hard fault            -1        

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值