关于中断使用

[复制链接]
 楼主| 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

粉丝
快速回复 在线客服 返回列表 返回顶部

153

主题

647

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部