维普资讯
2006年 第28卷 电气 传 动 自动 化 V01.28。No.6
第 6期 第 55页 ELECTRICDRIVEAUTOMAT10N 2006。28(6j:5557
文章编号:1005m7277(2006)06—()055—03
用 8259A扩展 8031单片机外部中断源的方法
米根锁 ,王瑞峰
(兰州交通大学 信息与电气工程学院,甘肃 兰州 730070)
摘要:Mcs一51系列单片机能提供给用户自由用作不同用途而不是指定用途的外部 中断源只有两个。在需
要有多个外部中断的应用场合,需要给单片机扩展外部中断源。用8259A可编程 中断控制器接口实现8031
外部中断源扩展的方法看似简单,实则存在着一些需要认真考虑和解决的问题,本文讨论了这些问题以及具
体的解决方法,给出了接 口电路和相关源程序结构。
关键词:Mcs 1系列单片机;8259A可编程中断控制器;外部中断源;扩展
中图分类号:TP391 文献标识码:A
Themethodofexpandingexteriorinterruptsourcesfor8031SCM with8259A
MIGen-suo,WANGRui-feng
(SchoolofInformation&ElectricdEngineering,LanzhouJiaotongUniversity,Lanzhou730070,China)
Abstract:TheMCS-51seriesSCMsofferonlytwoexteriorinterruptstotheuserforfreelyservedasthedifferent
usesbutarenotthegivenuse.Intheapplication situation thatneedstohavemany externalinterrupts,itis
neededtoexpandtheSCM Sexteriorinterrupts.Themethod,toexpandexteriorinterruptsourcesofr8031SCM
with8259A,lookssimple,butinnature,ithassomeproblemsneededtobethankbetterofandresolved.these
problemsaswellastheconcretesolutionarediscussed,theinterfaeeandtherelatedsourceprogram s【Iuctureare
provided.
,
Keywords:MCS一51seriesSCM;8259Aprogrammableinterruptcontroller;exteriorinterurptsources;expand
1 引言 状态读入8031CPU以便查询确定该次中断是由哪
个扩展外部中断源申请而引起 ,从而转到为该中
MCS一51系列单片机是单片机中的主导产品,
断源服务的相应程序执行。此方法硬件简单 ,软件
有着极其广泛的应用。在大部分应用场合,都需要
也易于编写,但对引起中断的扩展外部中断源的
用到其中断系统的功能。尽管Mcs一51系列单片