英文翻译—单片机解码的红外遥控器.doc_第1页
英文翻译—单片机解码的红外遥控器.doc_第2页
英文翻译—单片机解码的红外遥控器.doc_第3页
英文翻译—单片机解码的红外遥控器.doc_第4页
英文翻译—单片机解码的红外遥控器.doc_第5页
已阅读5页,还剩13页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Infrared remote control decoder microcontrollerAbstractRemote 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 、codes1 Infrared Technology1.1 InfraredIR (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 1000m wavelength of light are called infrared. Generally use infrared communication within the infrared band near infrared, wavelengths between 0.75m to 25m. Infrared is a wireless communication means for wireless data transmission1.2 Application of infraredExtremely 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 increasing1.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 format2.1 0 and 1 encodingRemote control signal emitted by the binary string of Os and 1s code. Different chip encoding of 0 and 1 are different. Manchester encoding and usually pulse width encoding. TC9012s 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 signal4 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 Bluetooth6.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. References1 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 InternationalMicrowave 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、空调等各种家用电器中,且价格便宜,市场上非常容易买到。如果能将遥控器上许多的按键解码出来用作单片机系统的输入则解决了常规矩阵键盘线路板过大、布线复杂、占用IO口过多的弊病。而且通过使用遥控器,操作时可实现人与设备的分离,从而更加方便使用。关键字:红外遥控、红外线、编码1 红外技术1.1 红外线红外线(Infrared rays)也是一种光线,由于它的波长比红色光(750nm)还长,超出了人眼可以识别的(可见光)范围,所以我们看不见它,又称为红外热辐射(Infrared Radiation),通常把波长为0.751000m的光都称为红外线。红外通讯一般采用红外波段内的近红外线,波长在0.75m至25m之间。红外线是一种无线通讯方式,可以进行无线数据的传输。1.2 红外线的应用红外线的应用极其广泛,可以广泛应用于医学、生物学、电子、通讯等各个行业。在现代电子工程应用中,红外线常常被用做近距离视线范围内的通讯载波,最典型的应用就是电视机的遥控器。使用红外线做信号载波的优点很多:成本低、传播范围和方向及距离可以控制(不会穿过墙壁,对隔壁家的电视造成影响)、不产生电磁辐射干扰,也不受干扰等等。随着红外线技术的日益成熟,标准的日益规范,红外线在通讯上的应用也就日益增多。1.3红外遥控构成主要由遥控发射器、一体化接收头、单片机、接口电路组成,如图一所示。遥控器用来产生遥控编码脉冲,驱动红外发射管输出红外遥控信号,遥控接收头完成对遥控信号的放大、检波、整形、解调出遥控编码脉冲。遥控编码脉冲是一组串行二进制码,对于一般的红外遥控系统,此串行码输入到微控制器,由其内部CPU完成对遥控指令解码,并执行相应的遥控功能。使用遥控器作为控制系统的输入,需要解决如下几个关键问题:如何接收红外遥控信号;如何识别红外遥控信号以及解码软件的设计、控制程序的设计。2编码格式2.1 0和1的编码 遥控器发射的信号由一串O和1的二进制代码组成不同的芯片对0和1的编码有所不同。通常有曼彻斯特编码和脉冲宽度编码。TC9012的O和1采用PWM方法编码,即脉冲宽度调制,其O码和1码如图1所示(以遥控接收输出的波形为例)。O码由O56ms低电平和056ms高电平组合而成脉冲宽度为112ms1码由056ms低电平和169ms高电平组合而成脉冲宽度为225ms。在编写解码程序时通过判断脉冲的宽度,即可得到0或1。图12.2 按键的编码 当我们按下遥控器的按键时,遥控器将发出如图2的一串二进制代码,我们称它为一帧数据。根据各部分的功能。可将它们分为5部分,分别为引导码、地址码、地址码、数据码、数据反码。遥控器发射代码时均是低位在前。高位在后。由图2分析可以得到引导码高电平为45ms,低电平为45ms。当接收到此码时表示一帧数据的开始。单片机可以准备接收下面的数据。地址码由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。接收到的是引导码,如果计时值等于112ms,接收到的是编码O。如果计时值等于2 25ms接收到的是编码1。在判断时间时,应考虑一定的误差值。因为不同的遥控器由于晶振参数等原因,发射及接收到的时间也会有很小的误差。 以接收TC9012遥控器编码为例,解码方法如下: (1)设外部中断0(或者1)为下降沿中断,定时器0(或者1)为16位计时器初始值均为O。 (2)第一次进入遥控中断后,开始计时。 (3)从第二次进入遥控中断起,先停止计时。并将计时值保存后,再重新计时。如果计时值等于前导码的时间,设立前导码标志。准备接收下面的一帧遥控数据,如果计时值不等于前导码的时间,但前面已接收到前导码,则判断是遥控数据的O还是1。 (4)继续接收下面的地址码、数据码、数据反码。 (5)当接收到32位数据时,说明一帧数据接收完毕。此时可停止定时器的计时,并判断本次接收是否有效如果两次地址码相同且等于本系统的地址,数据码与数据反码之和等于0FFH,则接收的本帧数据码有效。否则丢弃本次接收到的数据。 (6)接收完毕,初始化本次接收的数据,准备下一次遥控接收。5遥控代码与键盘码的转换 在应用系统中,带遥控器的仪器设备一般都带按键。而且二者功能相同。将遥控键值转换成标准的按键值后。遥控按键散转表格可以与键盘散转表格复用。转换方法可用查表法。通过查表。使遥控的按键值转换成本机键

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论