为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

英文翻译—单片机解码的红外遥控器

2018-01-17 17页 doc 110KB 26阅读

用户头像

is_005190

暂无简介

举报
英文翻译—单片机解码的红外遥控器英文翻译—单片机解码的红外遥控器 Infrared remote control decoder microcontroller Abstract Remote easy to use, features and more. Has been widely used in TV sets, VCD, DVD, air conditioning and other household appliances, and the price is cheap, very easy to buy on the market. If...
英文翻译—单片机解码的红外遥控器
英文翻译—单片机解码的红外遥控器 Infrared remote control decoder microcontroller Abstract Remote easy to use, features and more. Has been widely used in TV sets, VCD, DVD, air conditioning and other household appliances, and the price is cheap, very easy to buy on the market. If you can a lot of buttons on the remote control decoded. SCM system for the input.It is to solve the conventional matrix keypad circuit board is too large, complex wiring, occupy I / O port too many ills. And through the use of remote control operation can be the separation of man and equipment, which is more convenient to use. 、、Keywords: infrared remote control infrared codes 1 Infrared Technology 1.1 Infrared IR (Infrared rays) is a light, because of its wavelength than red light (750nm) is longer, than the human eye can identify the (visible light) range, so we can not see it, also known as infrared radiation (Infrared Radiation ), usually 0.75 ~ 1000μm wavelength of light are called infrared. Generally use infrared communication within the infrared band near infrared, wavelengths between 0.75μm to 25μm. Infrared is a wireless communication means for wireless data transmission 1.2 Application of infrared Extremely wide range of infrared applications, can be widely used in medicine, biology, electronics, telecommunications and other industries. In modern electrical engineering applications, the IR is often used as a close line of sight communications carrier, the most typical application is the TV remote control. Done using the infrared signal carrier has many advantages: low cost, scope and direction of propagation and distance can be controlled (not through the wall, on the impact of television next door), does not produce electromagnetic radiation, but also disturbed and so on. With infrared technology become more sophisticated, increasing the standard specification, the application of infrared in the newsletter also increasing 1.3 Infrared remote control form Mainly the remote control transmitter, integrated receiver, microcontroller, interface circuit, shown in Fig. Remote control remote control code used to generate pulses to drive infrared emission control infrared remote control signal output, remote control receiver to complete the remote signal amplification, detection, shaping, demodulation of the remote control code pulses. Coded pulse is a set of remote serial binary code, infrared remote control system for the general, this serial code input to the micro-controller, remote control by the internal CPU to complete the instruction decode, and execute the corresponding remote control. Using the remote control as the control system input, need to address the following key issues: how to receive infrared remote control signal; how to identify the infrared remote control signals, and decoding software design, control program design. 2 encoding format 2.1 0 and 1 encoding Remote control signal emitted by the binary string of O's and 1's code. Different chip encoding of 0 and 1 are different. Manchester encoding and usually pulse width encoding. TC9012's O and 1 encoded using PWM method, the pulse width modulation, the O code and 1 yard as shown in Figure 1 (the remote control receiver output waveform as an example.) O is supplied by O. 56ms combination of low and high 0.56ms. Pulse width of 1.12ms. 1 yard from the 0.56ms and 1.69ms high low combination. Pulse width of 2.25ms. Decoding procedure in the preparation. By determining the pulse width can be 0 or 1. 2.2 The encoding key When we press the remote control button, the remote control will send a string of binary code in Figure 2, we call it a frame of data. According to the function of each part. They can be divided into five parts, namely, boot code, address code, address code, data code, data counter code. Remote control transmitter code. Are low in the former. High in the post. Figure 2 can be obtained from the analysis. High boot code for the 4.5ms, low as 4.5ms. When receiving this code. That the start of a frame of data. SCM can be ready to receive the following data. 8-bit binary address code formed by a total of 256. The figure re-issued an address code. Are to enhance the reliability of the remote control. If the two address code is not the same. Is illustrated in the frame wrong. Should be discarded. Different devices can have a different address codes. So. The same encoding settings as long as the address of the remote control code is different and will not interfere with each other. The address map for the hexadecimal code 0EH (note least significant bit first.) In the same remote control. All keys issued by the address code is the same. 8-bit data code, and encoded 256 state, on behalf of the actual key pressed. Anti-code data is the data you find anti-code, code and data by comparing the data against code. Can determine the received data is correct. If the data code and data between anti-code does not meet the opposite relationship. The remote control receiver is wrong. Data should be discarded. In the same remote control. The data of all key codes are not the same. In Figure 2, the data as hexadecimal code 0CH, anti-code data in hexadecimal 0F3H (note least significant bit first.) Of both and should be 0FFH. 3 single chip remote control receiver circuit Infrared remote control receiver infrared receiver diode can be added earlier infrared processing circuit dedicated approach. If CXA20106, circuit complexity of this method, it is generally not used. Better integration of the receiver is to use infrared receiver, infrared receiver diodes will, amplification, demodulation, plastic and other circuits do together, only three pins. Are the +5 V power supply, the signal output. Common form of integration and the pin receiver shown in Figure 3 and Figure 4. Infrared receiver of the signal output connected microcontroller INTO or INTl feet. A typical circuit is shown in Figure 5. The figure increased by a PNP-type transistor to amplify the output signal 4 remote control signal decoding algorithms and programming When no key is pressed the remote control, infrared emitting diodes do not send a signal, the output signal a remote receiver. A key is pressed. O and 1-encoded reverse-phase high by remote control after the first output signal O. As connected with the microcontroller interrupt pin will cause an interrupt microcontroller (MCU pre-set for the falling edge). Microcontroller used in the interrupt timer 0 or timer 1 starts. To the next pulse arrives, the interrupt again, the first time the value out. Clear time value and then start the timer. By judging each interrupt with the previous time interval between interruption. They will know that the boot code is received, or O and 1. If the time is 9ms. Boot code is received, if the time value is equal to 1.12ms, received a code O. If the timer value is equal to 2 25ms. Received a code 1. In determining the time, consideration should be given a certain error. Because of the different parameters of the remote control causes the crystal, transmitting and receiving time there will be a small error. To receive the TC9012 remote control codes, for example, decoding method is as follows: (1) Let the external interrupt 0 (or 1) for the falling edge interrupt, timer 0 (or 1) for the 16-bit timer. The initial values are O. (2) After the first break into the remote control to start timing. (3) into the remote control from the second break, the first stop the clock. And the value of saving time, and then re-timing. If the timer value is equal to the preamble of the time, the establishment of a preamble symbol. Ready to receive the data following a remote control, if the time value is not equal to the preamble of the time, but the previously received preamble, the judge is O or 1 remote data. (4) continue to receive the following address code, data code, data counter code. (5) When 32-bit data is received, indicating that a data reception is completed. Time to stop the timer at this time, and determine the validity of this receiver. If the same address code and equal to twice the system address, data, code and data and is equal to anti-yards 0FFH, is receiving valid data code of the frame. Otherwise, discard this received data. (6) has been received, initialization data received this time, ready for the next remote control receiver. 5 code remote control code conversion with the keyboard In the application system, with remote control equipment generally with keys. And both feature the same. Will be converted into the standard remote button key value. Bulk transfer form remote control button to switch the keyboard loose form reuse. Conversion method can look-up table. Look-up table. The key value of the remote control unit keyboard, the value of the switching costs. In this way, you can use the key operation, you can also use the remote control, and the corresponding process is very simple.6 Comparison of infrared and Bluetooth 6.1 Characteristics of infrared technology Infrared communication technology for low-cost, cross-platform, point to point high-speed data connections, especially in embedded systems. The main application of infrared technology: equipment, connectivity and information gateway. Equipment after completion of different devices connected within the document and information exchange. Information gateway is responsible for connecting information terminals and the Internet. Infrared communication technology has been around the world supported by many hardware and software vendors and the use of, the current mainstream software and hardware platforms offer support for it. Infrared technology has been widely used in mobile computing and mobile communications devices. 6.2 Bluetooth features Bluetooth technology is used as a "cable replacement" technology proposed by the development of today has evolved into a personal information network technology. Bluetooth chip embedded devices will interconnect together to provide voice and data access services, to achieve the automatic exchange and processing of information. Bluetooth mainly for three categories of applications: voice / data access, peripherals, Internet and personal area network. Voice / data access is one computing device over a secure wireless link to connect to a communication device, complete with wide-area communication network interconnection. Peripheral Component Interconnect refers to a variety of peripherals via a Bluetooth link to connect to the host. The main application is the personal area network personal networks and information sharing and exchange. Bluetooth technology has been the response of the two thousand companies, which have huge development and production capacity. Bluetooth has a very high reputation, consumers are very interested in this technology the cost of the end of the infrared, and Bluetooth transfer speeds much faster than many, and infrared technology to the current technology is mature, so it further popularity will be a lot of space. Conclusion Through this infrared system design, so I basically mastered the IR knowledge.Infrared system with infrared transmitter, infrared receiver, the interface module, display module, etc. put together. Infrared technology generated by the industrial applications ranging from medical care, testing, aviation to military and other fields have a wide range of applications. I learned to make full use of library resources and network resources for independent study and research on the function of the common integrated circuit device and pin connection have a better understanding and awareness. It made me understand the importance of reading to find documents, usually more than the accumulation of knowledge and to use real time, so questions will be handy. References [1] J.L. Hall, Science 202 (1978) 13. [2] T. Rosenband et al., Science 319 (2008) 1808. [3] W.L. Eberhard, R.M. Schotland, Appl. Opt. 19 (1980) 2967. [4] L. Mullen, A. Vieira, P.R. Herczfeld, V.M. Contarino, in: IEEE MTT-S International Microwave Symposium, 1995, p. 1495. [5] L. Morvan, N.D. Lai, D. Dol,, J.-P. Huignard, M. Brunel, F. Bretenaker, A. Le Floch, Appl. Opt. 41 (2002) 5702. [6] A. Blanchard, Phase-locked Loops: Application to Coherent Receiver Design, Wiley-Interscience, New York, 1976. [7] R.C. Steele, Electron. Lett. 19 (1983) 69. [8] D.J. Malyon, D.W. Smith, R. Wyatt, Electron. Lett. 22 (1986) 421. [9] M. Kasevich, S. Chu, Phys. Rev. Lett. 67 (1991) 181. [10] D.M. Giltner, R.W. McGowan, S.A. Lee, Phys. Rev. Lett. 75 (1995) 2638. [11] E.M. Rasel, M.K. Oberthaler, H. Batelaan, J. Schmiedmayer, A. Zeilinger, Phys. Rev. Lett. 75 (1995) 2633. [12] T.L. Gustavson, A. Landragin, M.A. Kasevich, Classical Quant. Grav. 17 (2000) 1. 单片机解码的红外遥控器 摘 要 遥控器使用方便,功能多(目前已广泛应用在电视机、VCD、DVD、空调等各种家用电器中,且价格便宜,市场上非常容易买到。如果能将遥控器上许多的按键解码出来(用作单片机系统的输入(则解决了常规矩阵键盘线路板过大、布线复杂、占用I,O口过多的弊病。而且通过使用遥控器,操作时可实现人与设备的分离,从而更加方便使用。 关键字:红外遥控、红外线、编码 1 红外技术 1.1 红外线 红外线(Infrared rays)也是一种光线,由于它的波长比红色光(750nm)还长,超出了人眼可以识别的(可见光)范围,所以我们看不见它,又称为红外热辐射(Infrared Radiation),通常把波长为0.75,1000μm的光都称为红外线。红外通讯一般采用红外波段内的近红外线,波长在0.75μm至25μm之间。红外线是一种无线通讯方式,可以进行无线数据的传输。 1.2 红外线的应用 红外线的应用极其广泛,可以广泛应用于医学、生物学、电子、通讯等各个行业。在现代电子工程应用中,红外线常常被用做近距离视线范围内的通讯载波,最典型的应用就是电视机的遥控器。使用红外线做信号载波的优点很多:成本低、传播范围和方向及距离可以控制(不会穿过墙壁,对隔壁家的电视造成影响)、不产生电磁辐射干扰,也不受干扰等等。随着红外线技术的日益成熟,的日 益,红外线在通讯上的应用也就日益增多。 1.3红外遥控构成 主要由遥控发射器、一体化接收头、单片机、接口电路组成,如图一所示。遥控器用来产生遥控编码脉冲,驱动红外发射管输出红外遥控信号,遥控接收头完成对遥控信号的放大、检波、整形、解调出遥控编码脉冲。遥控编码脉冲是一组串行二进制码,对于一般的红外遥控系统,此串行码输入到微控制器,由其内部CPU完成对遥控指令解码,并执行相应的遥控功能。使用遥控器作为控制系统的输入,需要解决如下几个关键问:如何接收红外遥控信号;如何识别红外遥控信号以及解码软件的设计、控制程序的设计。 2编码 2.1 0和1的编码 遥控器发射的信号由一串O和1的二进制代码组成(不同的芯片对0和1的编码有所不同。通常有曼彻斯特编码和脉冲宽度编码。TC9012的O和1采用PWM 方法编码,即脉冲宽度调制,其O码和1码如图1所示(以遥控接收输出的波形为例)。O码由O(56ms低电平和0(56ms高电平组合而成(脉冲宽度为1(12ms(1码由0(56ms低电平和1(69ms高电平组合而成(脉冲宽度为2(25ms。在编写解码程序时(通过判断脉冲的宽度,即可得到0或1。 图1 2.2 按键的编码 当我们按下遥控器的按键时,遥控器将发出如图2的一串二进制代码,我们称它为一帧数据。根据各部分的功能。可将它们分为5部分,分别为引导码、地址码、地址码、数据码、数据反码。遥控器发射代码时(均是低位在前。高位在后。由图2分析可以得到(引导码高电平为4(5ms,低电平为4(5ms。当接收到此码时(示一帧数据的开始。单片机可以准备接收下面的数据。地址码由8位二进制组成,共256种(图中地址码重发了一次。主要是加强遥控器的可靠性(如果两次地址码不相同(则说明本帧数据有错(应丢弃。不同的设备可以拥有不同的地址码(因此。同种编码的遥控器只要设置地址码不同,也不会相互干扰。图中的地址码为十六进制的0EH(注意低位在前)。在同一个遥控器中(所有按键发出的地址码都是相同的。数据码为8位,可编码256种状态,代表实际所按下的键。数据反码是数据码的各位求反,通过比较数据码与数据反码(可判断接收到的数据是否正确。如果数据码与数据反码之间的关系不满足相反的关系(则本次遥控接收有误(数据应丢弃。在同一个遥控器上(所有按键的数据码均不相同。在图2中,数据码为十六进制的0CH,数据反码为十六进制的0F3H(注意低位在前)(两者之和应为0FFH。 图二 3单片机遥控接收电路 红外遥控接收可采用较早的红外接收二极管加专用的红外处理电路的方法。如CXA20106,此种方法电路复杂,现在一般不采用。较好的接收方法是用一体化红外接收头,它将红外接收二极管、放大、解调、整形等电路做在一起,只有三个引脚(分别是+5V电源、地、信号输出。常用的一体化接收头的外形及引脚见图3和图4。 图三 图四 红外接收头的信号输出接单片机的INTO或INTl脚(典型电路如图5所示(图中增加了一只PNP型三极管对输出信号进行放大。 图五 4遥控信号的解码算法及程序编制 遥控器无键按下时,红外发射二极管不发出信号,遥控接收头输出信号1。有键按下时(O和1编码的高电平经遥控头倒相后会输出信号O(由于与单片机的中断脚相连,将会引起单片机中断(单片机预先设定为下降沿产生中断)。单片 机在中断时使用定时器0或定时器1开始计时(到下一个脉冲到来时,即再次产生中断时,先将计时值取出。清零计时值后再开始计时(通过判断每次中断与上一次中断之间的时间间隔。便可知接收到的是引导码还是 O和1。如果计时值为9ms。接收到的是引导码,如果计时值等于1(12ms,接收到的是编码O。如果计时值等于2 25ms(接收到的是编码1。在判断时间时,应考虑一定的误差值。因为不同的遥控器由于晶振参数等原因,发射及接收到的时间也会有很小的误差。 以接收TC9012遥控器编码为例,解码方法如下: (1)设外部中断0(或者1)为下降沿中断,定时器0(或者1)为16位计时器(初始值均为O。 (2)第一次进入遥控中断后,开始计时。 (3)从第二次进入遥控中断起,先停止计时。并将计时值保存后,再重新计时。如果计时值等于前导码的时间,设立前导码标志。准备接收下面的一帧遥控数据,如果计时值不等于前导码的时间,但前面已接收到前导码,则判断是遥控数据的O还是1。 (4)继续接收下面的地址码、数据码、数据反码。 (5)当接收到32位数据时,说明一帧数据接收完毕。此时可停止定时器的计时,并判断本次接收是否有效(如果两次地址码相同且等于本系统的地址,数据码与数据反码之和等于0FFH,则接收的本帧数据码有效。否则丢弃本次接收到的数据。 (6)接收完毕,初始化本次接收的数据,准备下一次遥控接收。 5遥控代码与键盘码的转换 在应用系统中,带遥控器的仪器设备一般都带按键。而且二者功能相同。将遥控键值转换成标准的按键值后。遥控按键散转表格可以与键盘散转表格复用。转换方法可用查表法。通过查表。使遥控的按键值转换成本机键盘的值。这样既可以使用按键操作,也可以使用遥控操作,而且相应的处理程序非常简单。 6 红外与蓝牙的比较 6.1红外技术的特征 红外线通信技术适合于低成本、跨平台、点对点高速数据连接,尤其是嵌入式系统。红外线技术的主要应用:设备互联、信息网关。设备互联后可完成不 同设备内文件与信息的交换。信息网关负责连接信息终端和互联网。红外通讯技术已被全球范围内的众多软硬件厂商所支持和采用,目前主流的软件和硬件平台均提供对它的支持。红外技术已被广泛应用在移动计算和移动通讯的设备中。 6.2蓝牙技术的特征 蓝牙技术是做为一种“电缆替代”的技术提出来的,发展到今天已经演化成了一种个人信息网络的技术。它将内嵌蓝牙芯片的设备互联起来,提供话音和数据的接入服务,实现信息的自动交换和处理。蓝牙主要针对三大类的应用:话音,数据的接入、外围设备互联和个人局域网。话音,数据的接入是将一台计算设备通过安全的无线链路连接到一个通信设备,完成与广域通信网络的互联。外围设备互联是指将各种外设通过蓝牙链路连接到主机。个人局域网的主要应用是个人网络和信息的共享和交换。蓝牙技术已获得了两千余家企业的响应,从而拥有了巨大的开发和生产能力。蓝牙已拥有了很高的知名度,消费者对这一技术也很有兴趣由于红外成本底,且传输速度比蓝牙要快的多,而且红外技术发展到现在技术已经很成熟,所以将它更进一步的普及将会有很大的空间。 结 论 通过本次红外系统的设计,使我基本上掌握了红外的知识。红外系统有红外发射、红外接收、接口模块、显示模块等组合在一起的。由红外所产生的技术产业应用广泛,从医疗、检测、航空到军事等领域有着广泛的应用。我学会了充分利用图书馆资源和网络资源进行自主学习研究,对常见的集成电路器件的功能和引脚接法有了进一步的了解和认识。这让我明白了阅读查找文献的重要性,平时多积累知识,真正到了用的时候,做题才会得心应手。 参考文献 [1] J.L. Hall, Science 202 (1978) 13. [2] T. Rosenband et al., Science 319 (2008) 1808. [3] W.L. Eberhard, R.M. Schotland, Appl. Opt. 19 (1980) 2967. [4] L. Mullen, A. Vieira, P.R. Herczfeld, V.M. Contarino, in: IEEE MTT-S International Microwave Symposium, 1995, p. 1495. [5] L. Morvan, N.D. Lai, D. Dol,, J.-P. Huignard, M. Brunel, F. Bretenaker, A. Le Floch, Appl. Opt. 41 (2002) 5702. [6] A. Blanchard, Phase-locked Loops: Application to Coherent Receiver Design, Wiley-Interscience, New York, 1976. [7] R.C. Steele, Electron. Lett. 19 (1983) 69. [8] D.J. Malyon, D.W. Smith, R. Wyatt, Electron. Lett. 22 (1986) 421. [9] M. Kasevich, S. Chu, Phys. Rev. Lett. 67 (1991) 181. [10] D.M. Giltner, R.W. McGowan, S.A. Lee, Phys. Rev. Lett. 75 (1995) 2638. [11] E.M. Rasel, M.K. Oberthaler, H. Batelaan, J. Schmiedmayer, A. Zeilinger, Phys. Rev. Lett. 75 (1995) 2633. [12] T.L. Gustavson, A. Landragin, M.A. Kasevich, Classical Quant. Grav. 17 (2000) 1.
/
本文档为【英文翻译—单片机解码的红外遥控器】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索