节点文献
STC15单片机外部中断的特点及应用研究
Research on Characteristics and Application of External Interrupt on STC15 MCU
【摘要】 外部中断在单片机应用系统中经常用于系统故障处理、采集数据的处理、人机交互的键盘输入以及通过按键唤醒单片机退出掉电工作模式等工作场景。STC15系列单片机外部中断0、外部中断1增加了上升沿或下降沿均可触发中断的新特性,这种新特性在使用时如果不加以注意可能会使中断服务程序重复执行两次,导致程序出错,尤其是在采集数据的处理、人机交互的键盘输入等应用场合埋下隐患。通过对使用STC15系列单片机的外部中断0、外部中断1的实例分析,给出解决方案。对使用STC15系列单片机进行系统设计,尤其是对原来使用STC89系列等通用51单片机的系统进行硬件升级后的软件移植具有重要指导意义和参考价值。
【Abstract】 External interrupt is typically used in system fault processing,data acquisition,keyboard input and wake-up single-chip microcomputer to quit power-off mode.The external interrupt 0 and external interrupt 1 of STC15 series MCU add a new feature that the interrupt can be triggered by the rising edge or falling edge.If the user does not pay much attention to this feature,it may cause the interrupt service program to be executed twice,which will lead to a program error.This kind of new feature will have an underlying problem in the application of data acquisition processing,keyboard input of human-computer interaction and other applications.The examples of external interrupt 0 and external interrupt 1 of STC15 series MCU are discussed in this paper,the solutions are given.The study of this paper has important guiding significance and reference value for the system designed by STC15 series MCU,especially the software transplantation after a hardware upgrade of the original system used STC89 series and other general-purpose MCS 51 single-chip microcomputer.
- 【文献出处】 单片机与嵌入式系统应用 ,Microcontrollers & Embedded Systems , 编辑部邮箱 ,2021年02期
- 【分类号】TP368.1
- 【被引频次】5
- 【下载频次】444