I单片机红外控制发射器设计【详细】摘要随着社会的发展、科技的进步以及人们生活水平的逐步提高,各种方便于生活的遥控系统开始进入了人们的生活。传统的遥控器采用专用的遥控编码及解码集成电路,这种方法虽然制作简单、容易,但由于功能键数及功能受到特定的限制,只实用于某一专用电器产品的应用,应用范围受到限制。而采用单片机进行遥控系统的应用设计,具有编程灵活多样、操作码个数可随便设定等优点。本设计主要应用了AT89C2051单片机作为核心,综合应用了单片机中断系统、定时器、计数器等知识,应用红外光的优点。遥控操作的不同,遥控发射器通过对红外光发射频率的控制来区别不同的操作。遥控接收器通过对红外光接收频率的识别,判断出控制操作,来完成整个红外遥控发射、接收过程。其优点硬件电路简单,软件功能完善,性价比较高等特点,具有一定的使用和参考价值。关键词:单片机,红外遥控,中断,定时,计数,频率AbstractWiththedevelopmentofoursocietyandthegradualimprovementofscienceandtechnology,variouskindsofhelpremotecontrolsystemshavebegantoenterpeople’slife.Thetraditionalremotecontrollersadoptspecialremotecontrolcodeanddecodeintegratedcircuits,thoughthiskindofmethodissimplyandeasily,itisonlythepracticalapplicationofsomecertainspecialelectricequipmentsbecauseofthecountedfunctionalkeysiscountedandtherestrictedfunction,sotherangeofapplicationislimited.Buttheremotecontrollerswhichadoptthemicroprocessorshavemanyadvantagessuchasflexibleoperatingandunceremoniousmanipulativekeys.ThedesignhasusedAT89C2051microprocessorascore,integrativelyapplytheinterruptivesystem,timer,counter,etc.mainlytodesignoriginallyandalsotaketheadvantageoftheinfraredlight.Theremotecontrollauncherdistinguishesdifferentoperationthroughthecontrolonfrequencyofinfraredemissionoflight.Theremotecontrolreceiverjudgescontroloperationbyadoptingthediscernedfrequencyofthereceivedinfraredlighttofinishthewholelaunchingandreceivingcourse.IIItsadvantageisthatthehardwarecircuitissimple,thesoftwareiswithperfectfunction,havecertainuseandreferencevalueKeywords:Microprocessor,Infraredremotecontrol,Interrupt,Timing,Counting,Frequency目录摘要..........................................................................................................................IAbstract..........................................................................................................................I1绪论.......................................................................................................................51.1单片机的产生与发展.....................................................................................51.2红外通信技术概述..........................................................................................31.2.1红外概述................................................................................................31.2.2选择红外遥控的原因...........................................................................31.2.3红外的简单发射接收原理....................................................................42.1设计目的与原理.............................................................................................42.2单片机红外遥控发射器设计原理..................................................................42.3单片机红外遥控接收器设计原理.................................................................53系统硬件电路设计....................................................................................................63.1有关AT89C2051单片机的介绍....................................................................63.1.1简介........................................................................................................63.1.2引脚介绍................................................................................................63.1.3AT89C2051单片机的主要组成部分...................................................83.2定时器/计数器................................................................................................93.2.1主要特性................................................................................................93.2.2定时/计数器0和1的控制和状态寄存器........................................103.2.3T0和T1的4种工作方式..................................................................123.3独立式按键结构............................................................................................123.4低功耗控制电路............................................................................................133.4.1低功耗的实现方法..............................................................................133.4.2掉电保护和低功耗的设计.................................................................133.5CPU时钟电路............................................................................................16IV3.6复位电路................................................................................................173.6.1复位状态..............................................................................................173.6.2复位电路.............................................................................................173.7红外发射电路的设计...................................................................................183.8红外接收电路的设计...................................................................................193.9完整的系统电路设计图...............................................................................204系统软件设计.........................................................................................................204.1遥控发射器程序设计....................................................................................204.1.1程序总体结构......................................................................................204.1.2伪指令和初始化程序............