打印

关于中断使用

[复制链接]
1307|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
zteclx|  楼主 | 2010-9-5 09:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
从某8051的手册上摘的:
1. Clear interrupt flags
2. Set individual interrupt enable bit in the peripherals SFR, if any
3. Set the corresponding individual,interrupt enable bit in the IEN0, IEN1,
or IEN2 registers to 1
4. Enable global interrupt by setting the IEN0.EA = 1
5. Begin the interrupt service routine at the corresponding vector address of that interrupt.
翻译为:
1、清中断标志位
2、有必要的话,在SFR寄存器中设置独立的中断使能位
3、在1中对应寄存器的IEN0, IEN1,or IEN2 中单独设置中断使能位
4、开全局中断IEN0.EA = 1
5、在中断响应向量地址中开始中断服务
其中4,是每次中断都要的吗?如果开了的话,是不是就不用再开了?

相关帖子

沙发
HWM| | 2010-9-5 10:26 | 只看该作者
re LZ:

中断使能开一次即可,不用重开,除非被人为关闭。

使用特权

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

本版积分规则

153

主题

647

帖子

0

粉丝