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

下载本文档

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

文档简介

1、英文翻译单片机解码的红外遥控器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 c

2、ontrol 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:

3、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卩 m wavelength of light arelight) range, so we can not see it, also known as infrared radiatio

4、n (Infrared Radiation ), usually 0.75 1000卩 m to 25 卩 m.called infrared. Generally use infrared communication within the i nfrared band near infrared, wavelengths between 0.75Infrared is a wireless communication means forwireless data transmission1.2 Application of infraredExtremely wide range of in

5、frared 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 th

6、e 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 sop

7、histicated, increasing the standard specification, the application of infrared in the newsletter also increasing1.3 Infrared remote control formMainly the remote control transmitter, integrated receiver, microcontroller, interface circuit, shown in Fig. Remote control remote control code used to gen

8、erate 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 s

9、ystem 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 in

10、frared remote control signal; how to identify the in frared remote con trol sig nals, and decodi ng software desig n.con trol p rogram desig n. 2 en cod ing format2.1 0 and 1 encodingRemote con trol sig nal emitted by the binary stri ng of Os and 1s code. Differe nt chi p en cod ing of 0 and 1 are d

11、iffere nt. Man chester en cod ing and usually pu Ise width en codi ng. TC9012s O and 1 en coded using PWM method, the pu Ise width modulatio n, the O code and 1 yard as show n in Figure 1 (the remote con trol receiver out put waveform as an exa mp le.) O is supp lied by O. 56ms comb in ati on of low

12、 and high 0.56ms.P ulse width of 1.12ms. 1 yard from the 0.56ms and 1.69ms high low comb in ati on. P ulse width of 2.25ms. Decod ing p rocedure in the prep arati on. By determ ining the pu Ise width can be0 or 1.02.2 The en cod ing keyWhen we p ress the remote con trol butt on, the remote con trol

13、will send a stri ng of binary code in Figure 2, we call it a frame of data.Accord ing to the fun cti on of each p art. They can be divided into five p arts, n amely, boot code, address code, address code, data code, data coun ter code. Remote con trol tran smitter code. Are low in the former.High in

14、 the p ost. Figure 2 can be obta ined from the an alysis. High boot code for the 4.5ms, low as 4.5ms.When recei ving this code. That the start of a frame of data. SCM can be ready to receive the follow ing data. 8-bit binary address code formed by a totalof 256. The figure re-issued an address code.

15、 Are to enhance the reliability of the remote con trol. If the two address code is not the same. Is illustrated in the frame wrong. Should be discarded. Differe nt devices can have a differe nt address codes. So. The same en cod ing sett ings as long as the address of the remote con trol code is dif

16、fere nt and will not in terfere with each other. The address map for the hexadecimal code OEH (note least sig nifica nt bit first.) In the same remote con trol. All keys issued by the address code is the same. 8-bit data code, and en coded 256 state, on behalf of the actual key p ressed.An ti-code d

17、ata is the data you find an ti-code, code and data by comparing the data aga inst code. Can determ ine the received data is correct. If the data code and data betwee n an ti-code does not meet the opp osite relati onship. The remote con trol receiver is wrong. Data should be discarded. In the same r

18、emote con trol. The data of all key codes are not the same. In Figure 2, the data as hexadecimal code 0CH, an ti-codedata in hexadecimal 0F3H (note least sig nifica nt bit first.) Of both andshould be 0FFH.t; itt堆科i nag3 sin gle chip remote con trol receiver circuitIn frared remote con trol receiver

19、 in frared receiver diode can be added earlier in frared p rocess ing circuit dedicated app roach. IfCXA20106, circuit comp lexity of this method, it is gen erally not used.Better in tegrati on of the receiver is to use in frared receiver, i nfrared receiver diodes will, amp lificatio n, demodulati

20、on, p lastic and other circuits do together, only three pins. Are the +5 V po wer supply, thesig nal out put. Common form of in tegrati on and the pinreceiver show n in Figure 3 and Figure 4.匸a 5 r i:V I.厂、 閉b3OaTIn frared receiver of the sig nal out put conn ected microc on trollerINTO or INTI feet

21、. A typi cal circuit is show n in Figure 5. The figurein creased by a PNP-type tran sistor to amp lify the out put sig nal4 remote con trol sig nal decodi ng algorithms and p rogram mingWhen no key is p ressed the remote con trol, i nfrared emitti ng diodes do not send a sig nal, the out put sig nal

22、 a remote receiver. A key is p ressed. O and 1-e ncoded reverse-p hase high by remote con trol 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

23、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.B

24、oot 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 a

25、nd receivingtime 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

26、 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

27、 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

28、. 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 recei

29、ved, initialization data received this time, ready for the nextremote control receiver.5 code remote control code conversion with the keyboardIn the application system, with remote control equipment generally with keys. And both feature the same. Will be converted into the standard remote button key

30、 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 theswitching costs. In this way, you can use the key operation, you can also usethe remote con

31、trol, and the corresponding process is very simple.6Comparison of infrared and Bluetooth6.1 Characteristics of infrared technologyInfrared communication technology for low-cost, cross-platform, point to point high-speed data connections, especially in embedded systems. The main application of infrar

32、ed 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

33、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 featuresBluetooth technology is u

34、sed 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

35、. 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.

36、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

37、have huge development and production capacity. Bluetooth has a very high reputation, consumers are veryinterested in this technology the cost of the end of the infrared, and Bluetoothtransfer speeds much faster than many, and infrared technology to the currenttechnology is mature, so it further popu

38、larity will be a lot of space.ConclusionThrough 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 ra

39、nging 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

40、 understanding and awareness. It made me understand the importance of reading to find documents, usually more than theaccumulation 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

41、, R.M. Schotland, Appl. Opt. 19 (1980) 2967.4 L. Mullen, A. Vieira, P.R. Herczfeld, V.M. Contarino, in: IEEEMTT-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-lock

42、ed Loops: Application to CoherentReceiver 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

43、. 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空调等各种家用电器中,且价格便宜,市场上非常容易买到。如果能将遥控器上许多的按键解 码

44、出来 (用作单片机系统的输入 ( 则解决了常规矩阵键盘线路板过大、布线复杂、占用 I,O 口过多的弊病。而且通过使用遥控器,操作时可实现人与设备的分离,从而 更加方便使用。关键字: 红外遥控、红外线、编码1 红外技术1.1 红外线红外线(In frared rays)也是一种光线,由于它的波长比红色光(750nm)还长, 超出了人眼可以识别的 ( 可见光 ) 范围,所以我们看不见它,又称为红外热辐射(Infrared Radiation),通常把波长为0.75,1000 m的光都称为红外线。红外通讯一般采用红外波段内的近红外线,波长在0.75 um至25um之间。红外线是一种无线通讯方式,可以

45、进行无线数据的传输。1.2 红外线的应用红外线的应用极其广泛,可以广泛应用于医学、生物学、电子、通讯等各个行 业。在现代电子工程应用中,红外线常常被用做近距离视线范围内的通讯载波,最 典型的应用就是电视机的遥控器。使用红外线做信号载波的优点很多 : 成本低、传 播范围和方向及距离可以控制 (不会穿过墙壁,对隔壁家的电视造成影响 )、不产生电磁辐射干扰,也不受干扰等等。随着红外线技术的日益成熟,标准的日益规范,红外线在通讯上的应用也就日益增多。1.3 红外遥控构成主要由遥控发射器、一体化接收头、单片机、接口电路组成,如图一所示。遥 控器用来产生遥控编码脉冲,驱动红外发射管输出红外遥控信号,遥控接

46、收头完成 对遥控信号的放大、检波、整形、解调出遥控编码脉冲。遥控编码脉冲是一组串行二进制码,对于一般的红外遥控系统,此串行码输入到微控制器,由其内部CPU完成对遥控指令解码,并执行相应的遥控功能。使用遥控器作为控制系统的输入,需要解决如下几个关键问题:如何接收红外遥控信号;如何识别红外遥控信号以及解码 软件的设计、控制程序的设计。2编码格式2.1 0和1的编码遥控器发射的信号由一串0和1的二进制代码组成(不同的芯片对0和1的编码有所不同。通常有曼彻斯特编码和脉冲宽度编码。TC9012的0和1采用PWM方法编码,即脉冲宽度调制,其 0码和1码如图1所示(以遥控接收输出的波形为例)。0码由O(56

47、msf氐电平和0(56ms高电平组合而成(脉冲宽度为1(12ms(1码由0(56ms低电平和1(69ms高电平组合而成(脉冲宽度为2(25ms。在编写解码程0Jr L序时(通过判断脉冲的宽度,即可得到 0或1。图12.2按键的编码当我们按下遥控器的按键时,遥控器将发出如图2的一串二进制代码,我们称它为一帧数据。根据各部分的功能。可将它们分为5部分,分别为引导码、地址码、地址码、数据码、数据反码。遥控器发射代码时(均是低位在前。高位在后。由图2分析可以得到(引导码高电平为4(5ms,低电平为4(5ms。当接收到此码时(表示一帧数据的开始。单片机可以准备接收下面的数据。地址码由8位二进制组成,共2

48、56种(图中地址码重发了一次。主要是加强遥控器的可靠性 (如果两次地址码不相同(则说明本帧数据有错(应丢弃。不同的设备可以拥有不同的地址码 (因此。同种编码的遥控器只要设置地址码不同,也不会相互干扰。图中的地址码为十 六进制的0EH注意低位在前)。在同一个遥控器中(所有按键发出的地址码都是相 同的。数据码为8位,可编码256种状态,代表实际所按下的键。数据反码是数据码的各位求反,通过比较数据码与数据反码 (可判断接收到的数据是否正确。如果数据码与数据反码之间的关系不满足相反的关系 (则本次遥控接收有误(数据应丢弃。在同一个遥控器上(所有按键的数据码均不相同。在图 2中,数据码为十六进制的0CH

49、数据反码为十六进制的0F3H注意低位在前)(两者之和应为0FFH 卜引瞬巴_ _电址珂 _覺*科 i ttjq图二3单片机遥控接收电路红外遥控接收可采用较早的红外接收二极管加专用的红外处理电路的方法。如CXA20106此种方法电路复杂,现在一般不采用。较好的接收方法是用一体化红外接收头,它将红外接收二极管、放大、解调、整形等电路做在一起,只有三个引脚(分别是+5V电源、地、信号输出。常用的一体化接收头的外形及引脚见图3和图4。图三图四Mr宀匚?*5V 3OaT红外接收头的信号输出接单片机的INTO或INTI脚(典型电路如图5所示(图中 增加了一只PNP型三极管对输出信号进行放大。+5VVzTG

50、nd2. . 1Out14J1Uh1INTO(S)图五4遥控信号的解码算法及程序编制1。有遥控器无键按下时,红外发射二极管不发出信号,遥控接收头输出信号键按下时(0和1编码的高电平经遥控头倒相后会输出信号0(由于与单片机的中断脚相连,将会引起单片机中断(单片机预先设定为下降沿产生中断)。单片机在中断时使用定时器0或定时器1开始计时(到下一个脉冲到来时,即再次0和1。如果计时值为产生中断时,先将计时值取出。清零计时值后再开始计时(通过判断每次中断与上一次中断之间的时间间隔。便可知接收到的是引导码还是9ms接收到的是引导码,如果计时值等于 1(12ms,接收到的是编码 O如果计时值等于2 25ms

51、(接收到的是编码1。在判断时间时,应考虑一定的误差值。因为不同的遥控器由于晶振参数等原因,发射及接收到的时间也会有很小的误差。以接收TC9012遥控器编码为例,解码方法如下:(1)设外部中断0(或者1)为下降沿中断,定时器0(或者1)为16位计时器(初始值均为Q(2)第一次进入遥控中断后,开始计时。(3)从第二次进入遥控中断起,先停止计时。并将计时值保存后,再重新计时。如果计时值等于前导码的时间,设立前导码标志。准备接收下面的一帧遥控数 据,如果计时值不等于前导码的时间,但前面已接收到前导码,则判断是遥控数据 的0还是1。(4) 继续接收下面的地址码、数据码、数据反码。(5) 当接收到 32 位数据时,说明一帧数据接收完毕。此时可停止定时器的计 时,并判断本次接收是否有效 ( 如果两次地址码相同且等于本系统的地址,数据码 与数据反码之和等于OFFH则接收的本帧数据码有效。否则丢弃本次接收到的数 据。(6) 接收完毕,初始化本次接收的数据,准备下一次遥控接收。 5 遥控代码与 键盘码的转换在应用系统中,带遥控器的仪器设备一般都带按键。而且二者功能相同。将遥 控键值转换成标准的按键值后。遥控按键散转表格可以与键盘散转表格复用。转换6 红外与蓝方法可用查表法。通过查表。使

温馨提示

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

评论

0/150

提交评论