文件名称:51单片机外部中断仅检测上升沿的方法
- 所属分类:
- 文件格式
- 资源属性:
- 上传时间:
- 2017-09-25
- 文件大小:
- 11kb
- 下载次数:
- 0次
- 提 供 者:
- Augus******
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
STC15系列单片机的外部中断0(INT0)和外部中断1(INT1)的触发有两种方式,上升沿和下降沿均可触发方式和仅下降沿触发方式。在实际应用中,有时候需要上升沿触发。这时有两种方案可以解决。
1.将触发方式设置成仅下降沿触发。当外部电路产生一个上升沿时,通过硬件电路加一个三极管进行反向变成下降沿。
2.这种方法不需要改变硬件电路。将触发方式设置成上升沿和下降沿均可触发方式。外部中断产生一个上升沿时,进入中断服务函数,这时在中断服务函数里做进一步处理,检测当前INT0的电平状态。如果是高电平,则判断为上升沿。如果是低电平,则判断为是下降沿。(STC15 series microcontroller external interrupt 0 (INT0) and external interrupt 1 (INT1) trigger in two ways, the rising and falling sides can trigger mode and only the falling edge trigger mode. In practical applications, sometimes the rising edge is required to trigger. There are two possible solutions.
1. set the trigger mode to only the falling edge trigger. When an external circuit produces a rising edge, a transistor is added to the reverse direction by means of a hardware circuit.
2., this method does not need to change the hardware circuit. The trigger mode is set to the rising edge and the falling edge. When an external interrupt generates an ascending edge, it enters the interrupt service function, and then performs further processing in the interrupt service function to detect the level status of the current INT0. If it is high, it is judged to be the rising edge. If it is low, it is judged to be the falling edge.)
1.将触发方式设置成仅下降沿触发。当外部电路产生一个上升沿时,通过硬件电路加一个三极管进行反向变成下降沿。
2.这种方法不需要改变硬件电路。将触发方式设置成上升沿和下降沿均可触发方式。外部中断产生一个上升沿时,进入中断服务函数,这时在中断服务函数里做进一步处理,检测当前INT0的电平状态。如果是高电平,则判断为上升沿。如果是低电平,则判断为是下降沿。(STC15 series microcontroller external interrupt 0 (INT0) and external interrupt 1 (INT1) trigger in two ways, the rising and falling sides can trigger mode and only the falling edge trigger mode. In practical applications, sometimes the rising edge is required to trigger. There are two possible solutions.
1. set the trigger mode to only the falling edge trigger. When an external circuit produces a rising edge, a transistor is added to the reverse direction by means of a hardware circuit.
2., this method does not need to change the hardware circuit. The trigger mode is set to the rising edge and the falling edge. When an external interrupt generates an ascending edge, it enters the interrupt service function, and then performs further processing in the interrupt service function to detect the level status of the current INT0. If it is high, it is judged to be the rising edge. If it is low, it is judged to be the falling edge.)
相关搜索: STC51/外部中断/上升沿
(系统自动生成,下载前可以参看下载内容)
下载文件列表
51单片机外部中断仅检测上升沿的方法.docx