【正文】
unication in short distance within the function. Application of C51 microcontroller, SCM through the coding, decoding process to achieve the infrared signal sending and receiving, so as to realize the munication function of infrared remote control.Application of infrared transmitting tube and the receiving tube, plete the sending and receiving data. The transmitting tube and the receiving tube is connected to the mon I/O port. 2 buttons, a button is data of 0 and 1 transformation, another key is the send button. Data show that in the 1 digital tube.Key words: Microcontroller。紅外通信中,當(dāng)紅外二極管發(fā)送調(diào)制頻率為38KHz的紅外光時,才能被紅外接受二極管識別并接收,紅外接收波特率為1200波特,即每秒發(fā)送1200位,每位寬度為1/1200秒,即833us。P0口:P0口為一個8位漏級開路雙向I/O口,每腳可吸收8TTL門流。并因此作為輸入時,P2口的管腳被外部拉低,將輸出電流。P3口也可作為AT89C51的一些特殊功能口,如下表所示:口管腳 備選功能 RXD(串行輸入口) TXD(串行輸出口) /INT0(外部中斷0) /INT1(外部中斷1) T0(記時器0外部輸入) T1(記時器1外部輸入) /WR(外部數(shù)據(jù)存儲器寫選通) /RD(外部數(shù)據(jù)存儲器讀選通)P3口同時為閃爍編程和編程校驗接收一些控制信號。如想禁止ALE的輸出可在SFR8EH地址上置0。注意加密方式1時,/EA將內(nèi)部鎖定為RESET;當(dāng)/EA端保持高電平時,此間內(nèi)部程序存儲器。見圖3,在共陰極結(jié)構(gòu)中,各段發(fā)光二極管的陰極連在一起,將此公共點(diǎn)接地,某一段發(fā)光二極管的陰極為高電平時,該段發(fā)光。波特率為1200b/s MOV TH1,0E6H 。 (3)檢查各芯片的功能是否正常,檢測按鍵的導(dǎo)通情況。波特率為1200b/s MOV TH1,0E6H 。執(zhí)行顯示 LJMP D1CHECK1:LCALL DELAY JB ,D2 。掃描最低位 LCALL SEND0 D6: RR A DJNZ R4,D4 LCALL SEND1 RET D5: LCALL SEND1 SJMP D6SEND0:MOV R3,32 D7:SETB NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP CLR NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP DJNZ R3,D7 RETSEND1:MOV R3,32 D8:SETB NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP SETB NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP DJNZ R3,D8 RETDELAY:MOV R6,0FFHDELAY1:MOV R7,0FFHDELAY2:DJNZ R7,DELAY2 DJNZ R6,DELAY1 RET1000 0000SINT: JB RI,SINT1 。利用單片機(jī)來實(shí)現(xiàn)紅外通信技術(shù),結(jié)合通信原理中的數(shù)字信號編解碼技術(shù),研制出了一套簡單的紅外通信系統(tǒng)。但是程序的設(shè)計對我來說也是一個大難題,說實(shí)話,如果沒有借鑒同學(xué)的程序,我根本沒法完成程序的設(shè)計工作。1999[6]陳再清,微機(jī)—單片機(jī)紅外線通信,電子世界,2004