打印

c8051F120中断问题求解

[复制链接]
2183|4
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
DianGongN|  楼主 | 2011-12-22 16:30 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 DianGongN 于 2011-12-22 16:34 编辑

今天用到c8051f120,查看datasheet中对clr ea指令的描述,说必须后跟2机器周期的指令,否则可能进入中断。
很奇怪,intel手册没有说过。
请高手分析为什么会这样?有什么方法可以验证?

原文如下:
Note: any instruction which clears the EA bit should be immediately followed by an instruction which has two or more opcode bytes. For example:
// in 'C':
EA = 0; // clear EA bit
EA = 0; // this is a dummy instruction with two-byte opcode
; in assembly:
CLR EA ; clear EA bit
CLR EA ; this is a dummy instruction with two-byte opcode
If an interrupt is posted during the execution phase of a "CLR EA" opcode (or any instruction which clears the EA bit), and the instruction is followed by a single-cycle instruction, the interrupt may be taken. If the EA bit is read inside the interrupt service routine, it will return a '0'. When the "CLR EA" opcode is followed by a multi-cycle instruction, the interrupt will not be taken.

相关帖子

沙发
ayb_ice| | 2011-12-22 16:35 | 只看该作者
标准的51确实没有这些BUG
这是C8051F改进成流水线后的BUG,有些C8051也没有这个限制

使用特权

评论回复
板凳
DianGongN|  楼主 | 2011-12-22 16:51 | 只看该作者
本帖最后由 DianGongN 于 2011-12-22 16:53 编辑

请问是不是所有的C8051F都是这样的?
我看了其他型号的,不是很全。总结如下:
没明确有这回事的:c8051f020,c8051f060 ,c8051f340 ,c8051f350
      说有这回事的:c8051f120,c8051f130,c8051f320

没有规律,一头雾水

使用特权

评论回复
地板
ayb_ice| | 2011-12-22 17:17 | 只看该作者
没有明确说的应该没有问题

使用特权

评论回复
5
DianGongN|  楼主 | 2011-12-22 17:22 | 只看该作者
谢谢ayb_ice!

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

31

主题

1437

帖子

14

粉丝