Вы находитесь на странице: 1из 10

infrared Page 1 of 10

file://M:\import\html\8051 microcontroller page_files\infrared1.htm 5/26/00


Sorry, fhe IP goggIes sfiII nof working, buf we con go
oheod.
InfroPed is o rodiofion frequency beIow our eyes sensifivify, so we con nof see if, by fhe some woy we donf see sounds.
Even fhof we con nof "see sound frequencies", we know fhof if exisf, becouse we con heor if.
Even fhof we con nof see or heor infrored, we con feeI if of our skin femperofure sensors.
Jusf go cIose fo fire ond you wiII undersfond whof I meon, becouse heof emifs Iofs of infrored.
In reoI, fhis is fhe woy we profecf ourseIves from fire, feeIing fhe infrored in fhe sensors oII over our skin.
Infro-Ped is inferesfing, becouse if is eosiIy generofed ond doesnf suffer eIecfromognefic inferference, so if is niceIy used fo
communicofion ond confroI. Some ofher Iighf emissions couId confoins infrored os weII, ond fhof con inferfere in fhis
communicofion, fhe sun is on exompIe, since if emifs o wide specfrum or rodiofion.
The odvenfure of using Iofs of infro-red in TV/VCP remofe confroIs ond ofher oppIicofions, broughf infro-red diodes (emiffer
ond receivers) of very Iow cosf of fhe morkef.
From now on you shouId fhink os infrored os jusf o "red" Iighf.
This Iighf con meons somefhing fo fhe receiver, on or off con fronsmif differenf meonings.
Lofs of fhings con generofe infrored, onyfhing fhof rodiofe heof do if, incIuding ouf body, Iomps, sfove, oven, even fhe hof
wofer of fhe foucef.
To oIIow o good communicofion using infro-red, ond ovoid fhose "foke" signoIs, if is imperofive fo use o "key" fhof con feII fhe
receiver whof is fhe reoI dofo fronsmiffed ond whof is foke. As on onoIogy, our eyes con cofch o weok bIinking Iighf in middIe of
sfrong sfeody Iighfs, isnf 7
Fake Not Good Fake Not Good Fake Not Good Fake Not Good Fake Not Good Fake Not Good Fake Not Good Fake Not
Good Fake Not Good Fake Not Good Fake Fake Not Good Fake Not Good Fake Not Good Good Fake Fake Fake Not Good
Fake Not Good Fake Not Good Fake Not Good Fake Fake Fake Not Good Fake Not Good Fake
This is done using o puIsofing infrored. The receiver wiII onIy Iook for fhis infrored frequency.
If is esfobIished fhof frequencies from 30 fo o0kH; of puIsofing infrored is o conforfobIe woy fo
fronsmif informofion in Iow speed.
This is why mosf of infrored remofe confroIs use oround 3o or 40kH; puIsofing infrored.
To generofe o 40kH; puIsofing infrored is quife eosy, more difficuIf is fo receive ond idenfify
fhis frequency. This is why some componies produce infrored receives, fhof confoins fhe fiIfers,
decoding circuifs ond fhe oufpuf shoper, fhof deIivers o squore wove, meoning fhe exisfence or
nof of fhe 40kH; incoming puIsofing infrored.
If meons fhof fhose 3 doIIors smoII unifs, hove on oufpuf pin fhof goes high (+bV) when fhere is
o puIsofing 40kH; infrored in fronf of if, ond ;ero voIfs when fhere is nof fhis rodiofion.
A squore wove of opproximofeIy Z7uS (microseconds) injecfed of fhe bose of o fronsisfor, con
drive on infrored LED fo fronsmif fhis puIsofing Iighf wove. Upon ifs presence, fhe commercioI
receiver wiII swifch ifs oufpuf fo high IeveI (+bV).
infrared Page 2 of 10
file://M:\import\html\8051 microcontroller page_files\infrared1.htm 5/26/00
If you con furn on ond off fhis frequency of fhe fronsmiffer, your receivers oufpuf wiII
indicofe when fhe fronsmiffer is on or off.
Those IP demoduIofors hove inverfed Iogic of ifs oufpuf, when o bursf of IP is sensed if drives ifs oufpuf fo Iow IeveI, meoning
Iogic IeveI ~ I.
The TV, VCP, ond Audio equipmenf monufocfurers for Iong use infro-red of fheir remofe
confroIs. My firsf coIor TV in I97o used on uIfrosound (nof infrored) remofe confroI.
To ovoid o PhiIips remofe confroI fo chonge chonneIs in o Ponosonic TV, fhey use differenf
codificofions of fhe infrored, even fhof oII of fhem use bosicoIIy fhe some fronsmiffed frequency, from 3o fo b0kH;. So, oII of
fhem use o differenf combinofion of bifs or how fo code fhe fronsmiffed dofo fo ovoid inferference.
Some sfondords were creofed. As iIIusfrofive moferioI, we wiII onIy show one of fhem, fhe one used by PhiIips, even fhof we con
cover fhe ofher ones in fhe fufure.
Firsf of oII, PhiIips odopfed o sfondord fhof use fixed bif Iengfh ond fixed quonfify of bifs.
Eoch fime you press o buffon of fhe PhiIips remofe confroI, if sends o froin of I4 bifs, I.7Z8ms per bif, fhe whoIe froin is
repeofed every I30ms if you keep fhe buffon pressed
Eoch bif is sIiced in fwo hoIves. The Ieff ond righf hoIf hos opposed IeveIs. If fhe bif fo be fronsmiffed is one (I), ifs Ieff side
is ;ero whiIe ifs righf side is one. If fhe bif fo be fronsmiffed is ;ero (0), ifs Ieff side is one whiIe fhe righf side is ;ero.

(This is fhe righf Iogic, reversed from whof you con see of fhe IP receiver oufpuf.)
infrared Page 3 of 10
file://M:\import\html\8051 microcontroller page_files\infrared1.htm 5/26/00
If meons fhof fhe second hoIf of fhe bif is ocfuoIIy fhe some meoning of fhe bif fo be fronsmiffed, os you con see of fhe
shoded bIue righf side of fhe bif os on, meons bif fronsmiffed ~ I.
If you wonf fo meosure fhe correcf Iogic IeveI direcfIy from fhe Peceiver Oufpuf, you shouId meosure of fhe firsf hoIf of fhe
bif.
The correcf inferprefofion, is fhof if chonges IeveI exocfIy of fhe middIe of bif fime. Af fhe IP Peceiver oufpuf o bif Zero
chonges IeveI from Low fo Up, whiIe o bif One chonges IeveI from Up fo Low.
There ore o minimum quonfify of incoming Z7ps puIses fo fhe demoduIofor undersfond if is of fhe righf frequency ond fhen
drop ifs oufpuf. The quonfify of puIses used of fhe PhiIips remofes ore 3Z puIses per eoch hoIf of fhe bif, o4 puIses per bif.
So, o bif "0" fo be fronsmiffed if meons 3Z squore puIses of Z7ps eoch, fhen 3Z x Z7ps of siIence. The bif "I" is fhe opposife,
3Z x Z7ps of siIence foIIowed by 3Z squore puIses of Z7ps.
Our job here wiII be fo decode fhe receiving of fhe woveform of fhe demoduIofor oufpuf. We couId observe fhe direcfion of
fhe chonging of fhe middIe of fhe bif, if going down, meons bif 0, going up, meons bif I. 8uf if is eosy fo sompIe fhe middIe of
fhe firsf hoIf of fhe bif, so if direcfIy feIIs us whof is fhe bif sfofe, os we wiII see nexf in fhis fexf.
The PhiIips remofe confroI sends I4 bifs in sequence os you con see beIow. (I om sorry fo need fo use more fhon your monifor
widfh for fhe nexf picfure, buf if is fo beffer view if).
(Figure 7)
You con see fhe I4 bifs of fhe PC-b sysfem obove. The PED bifs ore IeveI "OM", whiIe 8Iue ore "OFF".
The firsf fwo bifs, #I ond #Z, ore coIIed AC0 coIibrofion. They ore "OM" IeveI, ond serve fo coIibrofe fhe IP Peceivers
Aufo 0oin ConfroI.
In fhe PhiIips remofes, fhe bif #3 is fhe CHECI bif, every fime you press o key of fhe remofe, even pressing repeofedIy
fhe some key, fhis bif fIips sfofe. This feofure is inferesfing. Suppose you pressed number "I" of fhe remofe (frying fo
seIecf chonneI Ib of TV) ond hoIding if for Z seconds, fhen your ofher hond jusf bIocks fhe InfroPed signoI. The TV
wouId receive fwo froins of puIses, generofed by your hond breoking o Iong froin in fwo. Ofher sysfems wouId
undersfond fronsmission of fwo keys "I" seIecfing chonneI "II", buf fhis do nof hoppens in fhe PhiIips sysfem. This bif
fIips sfofe every fime you press o key, so bIocking fhe signoI wifh your hond doesnf chonge fhis bif, so fhe TV wiII
undersfond fhof sfiII fhe some key pressed. To seIecf chonneI "II" you shouId press key "I" reoIIy fwice.
The nexf b bifs, #4 fo #8, ore used for SYSTEM ADDPESS, or fo idenfify which kind of device shouId execufe fhe
COMMAMD bifs. For exompIe, TV sef uses ADDPESS ZEPO. 8if #8 is fhe Less Significonf 8if.

infrared Page 4 of 10
file://M:\import\html\8051 microcontroller page_files\infrared1.htm 5/26/00
The nexf o bifs, #9 fo #I4, ore used for COMMAMD informofion fo fhe device seIecfed of fhe ADDPESS bifs. 8if
#I4 is fhe LESS SI0MIFICAMT 8IT, ond if is Iosf fronsmiffed.
For exompIe, STOP key uses COMMAMD #b4 (3oh in hexodecimoI), bifs #9, #I0, #IZ ond #I3 shouId be OM, bifs #II
ond #I4 shouId be OFF.

This sysfem con be oufomofed if using fhe chips:
SAA3049 or TDA3048 for receivers ond SAA300o, SAA30I0 or SAA30Z7 os fronsmiffers.

DECODIM0 WITH A MICPOCOMTPOLLEP
To receive fhis signoI using o microconfroIIer, foIIows fhe fiming from fhe figure 7 obove. Mofe fhof fhe Infrored
Peceiver inverf fhe bif signoI, Iow IeveI meons bif OM.
During inocfivify (no Infrored presenf) fhe oufpuf of fhe Infrored receiver is UP (bif ;ero).
SYSTEM ADDPESS EQUIPMEMT
0 TV SET
Z TELETEXT
b VIDEO PECOPDEP
7 EXPEPIMEMTAL
Io PPEAMPLIFIEP
I7 PECEIVEP / TUMEP
I8 TAPE / CASSETE PECOPDEP
I9 EXPEPIMEMTAL
COMMAMD (in decimoI) DESCPIPTIOM of FUMCTIOM
0-9 MUMEPIC IEYS 0 - 9
IZ STAMD8Y
I3 MUTE
I4 PPESETS
Io VOLUME UP
I7 VOLUME DOWM
I8 8PI0HTMESS +
I9 8PI0HTMESS -
Z0 COLOP SATUPATIOM +
ZI COLOP SATUPATIOM -
ZZ 8ASS UP
Z3 8ASS DOWM
Z4 TPE8LE +
Zb TPE8LE -
Zo 8ALAMCE PI0HT
Z7 8ALAMCE LEFT
48 PAUSE
b0 FAST PEVEPSE
bZ FAST FOPWAPD-
b3 PLAY
b4 STOP
bb PECOPD
o3 SYSTEM SELECT
infrared Page 5 of 10
file://M:\import\html\8051 microcontroller page_files\infrared1.htm 5/26/00
You con connecf fhe IP receiver oufpuf fo ony inpuf porf pin or inferrupf pin of your microconfroIIer, ond keep poIIing if
or prepore fhe inferrupf roufine fo frigger your reoding offer fhe firsf Iow IeveI sensed.
When you press o key of fhe remofe, if fronsmifs fhe froin of puIses, ond your microconfroIIer wiII receive bif #I firsf.
If wiII be sensed righf offer fhe middIe of fhe bif when if chonges from high fo Iow IeveI fo meons bif "I". This is fhe
firsf fime fhof your microconfroIIer wiII "see" fhe incoming IP signoI.
You donf need fo decode fhose firsf fwo bifs, nof even fhe CHI bif (excepf if you wonf fo confroI os fhe TV do ond
described obove), so you con skip fhose 3 bifs ond sforf fo receive fhe ADDPESS bifs. To do fhof, you need fo skip
Z.7b bifs fime, ond you wiII be exocfIy of fhe middIe of fhe righf IeveI of fhe firsf ADDPESS bif fo be reod (non
inverfed IeveI).

Figure 8
So, upon sensing fhe firsf Iow IeveI, your soffwore shouId woif 4.7bZ miIIiseconds ond fhen sforf fo reod fhe nexf II bifs
spoced I.7Z8ms eoch. The firsf b bifs ore Address ond fhe nexf o bifs ore Commond, Iogic correcf IeveI, LOW ~ 0,
HI0H ~ I.
To moke sure your soffwore is woifing fhe correcf fiming, you need fo use o duoI chonneI osciIIoscope, ond fhis procedure
fo odjusf your soffwore:
Af your bif reoding roufine use on ovoiIobIe microconfroIIer porf pin ond generofe o fosf puIse UP ond DOWM, fhen use
one scope chonneI fo dispIoy fhis puIse, ond fhe ofher scope chonneI fo show fhe incoming signoI from fhe receiver.
Press ond hoId key number ZEPO of fhe remofe, ond sync fhe scope fo show o compIefe wove form, donf worry wifh
fiming. The fosf II puIses shouId oIwoys be in pIoce of fhose PED down orrows of fhe figure 8 obove. If meons fhof fhe
"bif reoding" soffwore roufine wiII reoding exocfIy in fhe middIe of fhe correcf bif IeveI.
Your soffwore wiII need fo hove fwo fiming deIoys, fhe firsf fo woif 4.7bZms ond fhe second fo woif I.7Z8ms. Adjusf
fhe fiming Ioop from fhe 4.7bZms unfiI fhe firsf fosf puIse hoppens exocfIy os indicofed obove. Then odjusf fhe I.7Z8
ms fiming deIoy in such woy fhof fhe Iosf fosf puIse (#II) bif reoding hoppens exocfIy of fhe middIe of fhe Iow porf of
fhe Iosf bif (#I4).
Check oII ofher bifs ond fosf puIses, fhey shouId be oII mofching ok. SmoII errors wouId be occepfed since fhe reoding
wouId be hoppening in fhe middIe of fhe bif, few errors for more or Iess is nof o probIem, buf if is beffer fo be fhe
mosf possibIe in fhe middIe of fhe Iow IeveI of eoch bif. This is why you shouId odjusf your I.7Z8ms fiming roufine
Iooking of fhe Iosf dofo bif ond fosf puIse, if fhey mofch somehow ok, oII fhe ofher bifs shouId be ok foo.
Pemember fhof ony ofher remofe key wiII generofe o differenf poffern ond if con confuse you. Use oIwoys key number
ZEPO for fhis soffwore coIibrofion.
infrared Page 6 of 10
file://M:\import\html\8051 microcontroller page_files\infrared1.htm 5/26/00
Once you find fhe correcf fiming deIoys, you con repIoce fhe FAST puIse insfrucfions wifh MOPS (check your chip
insfrucfion sef fo keep fhe some cIock counf wosfed), or keep fhe fosf puIse fhere jusf for fun, so you wiII be obIe fo
recheck if in cose of probIems.
Peoding fhe II bifs is eosy. Jusf shiff fhem Ieff info o 8 bifs regisfer ond ignore fhe high order Z bifs #7 ond #o
(AMD 03Fh insfrucfion), keep onIy fhe COMMAMD Iosf o bifs... You wiII nof wonf fo decode fhe ADDPESS bifs, ore you7
The TV remofe confroI wiII oIwoys send Address Zero, you know fhof, righf7
Here few exompIes of fhe compIefe woveform (I4 bifs) of fhe Peceiver Oufpuf:

VoIues of fhe righf ore fhe commond in hexodecimoI
Ped: A0C puIses (OM)
8Iue: Check bif (fIipping)
Whife: Address (00)
0reen: Commond
SAFETY
If you wonf fo incIude some sofefy (recommended), check bifs #7 ond #o for ZEPOS, if if is o PhiIips TV remofe. You
con oIso nof use fhe 4.7bZms deIoy, insfeod, woif onIy 3/4 of o bif fime, ond fhen sforf fo reod from fhe bif #Z. You
wiII suppose fhe firsf one wos o "I" ond fhe second shouId be o "I" foo, if nof, discord fhem, woif o0ms ond ocfivofe
recepfion ogoin, you shouId sync correcfIy of fhe beginning of fhe nexf froin of puIses. 8uf even fhis woy, you couId reod
wrongIy o "I" bif foIIowed by onofher if fhe reoding sforf onywhere in fhe middIe of fhe froin.
To moke sure your confroIIer is never sforfing fo reod fhe froin in fhe middIe, you con discord fhe firsf reoding oIwoys
offer o Iong siIence (hoIf second or more), so you wiII moke sure fhof fhe second reoding wiII be in sync. To do fhof,
offer idIing for more fhon hoIf second, enfer in o specioI sync roufine ond upon sensing fhe firsf LOW IeveI bif (con be
fhe reoI firsf or nof), woif o0ms ond jump fo fhe reoI receive roufine ond sforf fo monifor fhe Peceiver oufpuf ogoin. If
meons fhof fhe firsf froin wiII be used jusf fo mokey your receive roufine fo engoge in o correcf fimming fo reod fhe
second froin of puIses.
Pemember fhof fhere is o deIoy of I0bms befween puIse froins, so doesnf moffer which LOW bif you sensed, woifing
o0ms wiII puf your recepfion roufine in fhe middIe of fhe siIence befween puIse froins, oIIowing if fo sync of fhe firsf
bif of fhe nexf froin of puIses.

AT89CZ0bI IP PECEIVEP
infrared Page 7 of 10
file://M:\import\html\8051 microcontroller page_files\infrared1.htm 5/26/00
80bI ASSEM8LEP CODE
;
;
;
;
;
;
;
;
; SOFTWARE FOR AT89C2051 TO DECODE PHILIPS REMOTE CONTROL
; RC-5 CODIFICATION - INFRA-RED RECEIVER LT1029-ND DIGIKEY
; CLIPPED PARTS FROM THE ORIGINAL SOURCE TEXT:
; A) TRANSMITTER
; B) SELECTION FOR PHILIPS / FC1 - (WORKING PHILIPS)
; AT89C2051 RUNNING AT 2MhZ <== IMPORTANT
; WAGNER LIPNHARSKI - NOVEMBER 1999 - WAGNER@USTR.NET
; UST RESEARCH INC. - ORLANDO, FL - WWW.USTR.NET
;
$MOD51
$NOPAGING
$LIST
;
; PIN 11 (P37) : 0 = RECEIVER CIRCUIT
; : 1 = TRANSMITTER CIRCUIT
;
; PIN 2 (P30) : 1 = RECEIVER DECODES PHILIPS REMOTE
; : 0 = RECEIVER DECODES FC1 REMOTE
;
; PIN 12 (P10) : PULLED UP = FC1 CODE TRANSMITTER
; : GROUND = PHILIPS CODE TRANSMITTER
;
; RECEIVER CONFIGURATION:
; -----------------------
; PIN 7 (P33) INPUT SIGNAL FROM IR RECEIVER
infrared Page 8 of 10
file://M:\import\html\8051 microcontroller page_files\infrared1.htm 5/26/00
; PINS 12-19 DECODER OUTPUT (DRIVE TO GROUND)
; PIN 11 TO GROUND.
; CLOCK CERAMIC RESSONATOR 2MhZ
; RESET CAP 1uF TO +VCC
; PIN 9 (P35) CAN BE USED TO LITE A LED WHEN RECEIVING VALID IR
; PIN 8 (P34) SCOPE GATE TIME (SOFTWARE TIMMING ADJUSTMENT)
;
; ---___---___------______---___---___--- PIN 7 P33 IRDATA
; _|_____|_____|_____|_____|_____|_____|_ PIN 8 P34 SCOPE READ GATE TIME
;
; --__ 1 BIT
; RX DATA
; __-- 0 BIT
;
; TRANSMITTER CONFIGURATION:
; --------------------------
; PINS 2,3,6,7,8,9 & 11 TIED TOGETHER TO DRIVE IR LED
; PINS 16-19 KEYBOARD MATRIX DRIVE (4 PINS)
; PINS 14 & 15 KEYBOARD MATRIX RETURN WITH PULL UP
; CRYSTAL 6MHZ
; RESET CONTROLLED BY FET BS110, DIODES FROM KEYBOARD.
; PIN 12 GOES TO GROUND WHEN IN POWER OFF
;------------------
; Receiver
;------------------
Led BIT 0B5h ; P3.5
IrInput BIT 0B3h ; P3.3
Scope BIT 0B4h ; P3.4
RxTx BIT 0B7h ; P3.7 ; Grounded if Receiver/High if TX
;------------------
; Transmitter
;------------------
TXLED EQU P3 ; FF = Off, 00 = On
KO1 Bit 097h ; P1.7 Keyboard Output
KO2 Bit 096h ; P1.6
KO3 Bit 095h ; P1.5
KO4 Bit 094h ; P1.4
KI1 Bit 093h ; P1.3 Keyboard Input
KI2 Bit 092h ; P1.2
IRDATA DATA 010H ; Memory to store IR code received
;======================================;
;
; P H I L I P S R E M O T E
; CODE "10" AT AV6 UNIVERSAL PROGRAMMABLE REMOTE CONTROL
;
;======================================;
ORG 00H
MAIN: Mov SP,#SPVALUE ;
PH0: Mov P1,#0FFh ; Reset Decoder Output High
Setb LED ; Turn off IR Indicator
; ;
PH1: Mov 4,#022 ; 2MHz
Mov 5,#000h ; 2MHz Time loop
PH2: Jnb IrInput,PH3 ; Wait for Incomming IR (first low)
Djnz 5,PH2 ; This time loop is to keep the last
Djnz 4,PH2 ; ..pressed key available at P1 for few
Jmp PH0 ; ..time in case you press it again
; ..and avoid glitches at P1.
;-------------------------;
PH3: Clr A ; IR Receiver First Low level.
Clr Led ; Lite IR Indicator
; ;
Mov 2,#110 ; Time Loop (3/4 bit time)
Djnz 2,$ ; Waste Time to sync second bit
infrared Page 9 of 10
file://M:\import\html\8051 microcontroller page_files\infrared1.htm 5/26/00
; ; 2MHz = 1.296ms
Mov B,#7 ;
PH4: Setb Scope ; Scope Gate Indicator Pulse UP
Mov C,IrInput ; Shift IR state to Carry bit
Clr Scope ; Scope Gate Indicator Pulse Down
Rlc A ; Insert LEFT Carry Bit into A Reg
; ;
Mov 2,#145 ; Waste time for next BIT
Djnz 2,$ ; 2MHz clock, 1.728ms
; ;
Djnz B,PH4 ; Rotate 7 bits into A
; ; AGC#2, CHKbit, ADDRESS field (5 bits)
;-------------------------;
Anl A,#0F7h ; Cut off CHECK Bit (Flipping bit)
Cjne A,#40h,PH5 ; 10h means second AGC UP & Address 00
; ; Not 10h?, wrong sync, go again (PH5)
;-------------------------;
Mov B,#6 ; Will Get the COMMAND field
PH4A: Setb Scope ; Scope Gate Indicator Pulse UP
Mov C,IrInput ; Shift IR state into Carry bit
Clr Scope ; Scope Gate Indicator Pulse Down
Rlc A ; Insert LEFT carry bit into A Reg
; ;
Mov 2,#145 ; Waste time for next BIT
Djnz 2,$ ; 2MHZ clock = 1.728ms
; ;
Djnz B,PH4A ; Rotate 8 bits into A (Command)
; ; Here A holds Command bits
;-------------------------;
Mov IRData,A ; Save Command at IRData memory
Cjne A,#25h,$+3 ; Is Command >=25h
Jnc PH5 ; Yes? Wrong everything, go again PH5
; ;
Call PH6 ; Go get Conversion at Table
Cjne A,#0FFh,PH4B ; If conversion <> FF, is valid.
Jmp PH5 ; ..Not Expected Command. go again PH5
; ;
PH4B: Mov P1,A ; Valid Command is post at P1 Port
Jmp PH1 ; Job done, go wait next pulse train.
; ;
;-------------------------;
PH5: Mov 3,#8 ; 2MHz
Mov 2,#112 ; Wait 15 bit time
PH5A: Djnz 2,$ ; Wasting time to sync ok next train
Djnz 3,PH5A ;
Jmp PH0 ; Go back and wait for next train.
;-------------------------;
PH6: Inc A ; Table conversion, Inc skip RET
Movc A,@A+PC ; Point to TABLE + Value at A (1-255)
Ret ;
;-------------------------;
; The following table bit values at the first column, means
; the translation from remote control key to the value to be
; be post at P1. The program ignores values of "FF".
; Change those bits according to your needs.
;
; Bit #7 is "0" when a valid key is pressed, otherwise is "1"
; It can be used to recognize values as key "zero" pressed,
; when all bits UP means command ZERO.
;
; This TV remote uses only Address = "00"
;
; PHILIPS TV REMOTE CONTROL DECODING
;
; VALUE TO P1 REMOTE KEY COMMAND CODE FIELD (HEX)
; ----------- ---------- ------------------------
TABLE: DB 01111111b ; 0 ; 0
DB 01111110b ; 1 ; 1
DB 01111101b ; 2 ; 2
DB 01111100b ; 3 ; 3
DB 01111011b ; 4 ; 4
infrared Page 10 of 10
file://M:\import\html\8051 microcontroller page_files\infrared1.htm 5/26/00
DB 01111010b ; 5 ; 5
DB 01111001b ; 6 ; 6
DB 01111000b ; 7 ; 7
DB 01110111b ; 8 ; 8
DB 01110110b ; 9 ; 9
DB 11111111b ; ; A
DB 11111111b ; ; B
DB 01110011b ; ON/OFF ; C
DB 01110010b ; MUTE ; D
DB 01110001b ; PP ; E
DB 01110000b ; OSD ; F
DB 01101111b ; Volume+ ; 10
DB 01101110b ; Volume- ; 11
DB 01101101b ; Bright+ ; 12
DB 01101100b ; Bright- ; 13
DB 01101011b ; Color+ ; 14
DB 01111010b ; Color- ; 15
DB 11111111b ; ; 16
DB 11111111b ; ; 17
DB 11111111b ; ; 18
DB 11111111b ; ; 19
DB 11111111b ; ; 1A
DB 11111111b ; ; 1B
DB 01100011b ; Contrast+ ; 1C
DB 01100010b ; Contrast- ; 1D
DB 11111111b ; ; 1E
DB 11111111b ; ; 1F
DB 01011111b ; Program+ ; 20
DB 01011110b ; Program- ; 21
DB 11111111b ; ; 22
DB 11111111b ; ; 23
DB 01011011b ; Timer ; 24
DB 01010111b ; Special 1 ; 25
DB 01000001b ; Special 2 ; 26
DB 01000111b ; Special 3 ; 27
DB 01001110b ; Special 4 ; 28
DB 01000101b ; Special 5 ; 29
DB 01010010b ; Special 6 ; 2A
END
If you wonf fo posf here your hordwore/soffwore soIufion wifh o PIC, emoiI me.
I om sorry, EngIish wos nof reviewed, shouId hove ;iIIions of errors. Mo fime fo do fhof fhis week. Money is more
imporfonflll :)
0ood Luck.

Вам также может понравиться