e01a026.PDF

(285 KB) Pobierz
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
TEST &MEASUREMENT
IR Code Analyser
identify remote control codes!
Point any IR remote controller at this nifty device and its in-built micro-
controller will quickly analyse the signal and reveal which of eight stan-
dard control protocols the controller is using.
Microcontroller
–4 KByte ROM
– 128 Byte RAM
– 32 Byte EEPROM for user code
–2.7 to 6 V Supply voltage
–Two 16 Bit Timer/Counter
– Integrated reset
– Internal RC Oscillator
(selectable)
–20mA drive current
from all the port pins
– Maximum 18 I/O-Pins,
when the internal reset and RC
oscillator is used.
–2 analogue comparators
–I 2 C interface
–Full duplex UART
– Serial In-circuit Programmable
It’s a rare piece of entertainment equipment
that does not come with its own remote con-
troller. After a few years it’s easy to accumu-
late a drawer-full of (functional) controllers
belonging to equipment long since consigned
to showrooms at your local household
amenity tip.
Equipment manufacturers tend to use dif-
ferent controller protocols so it is rare to find
by chance a controller from one manufacturer
able to control equipment from another. All of
the protocols used should however comply
with one of the eight industry standards.
Many electronics enthusiasts can proba-
bly think of lots of applications for a
discarded remote controller. For
example using the well-documented
RC5 or RECS80 protocol from Philips
a simple receiver/decoder can be
built using the SAA3009 or SAA3049
IC from Philips if only you knew
details of the controller coding. Sim-
ilarly if you are looking for a second
controller for a piece of equipment its
not practical to lug a portable oscil-
loscope to the local car boot sale to
analyse each controller on offer.
This device offers the ideal solu-
tion. The chief design criteria for the
IR analyser was to produce a neat,
portable unit that would quickly
enable a check to be made of the
output signal of an unknown remote
controller. A microcontroller decodes
the IR message and displays the
important information on an LCD. In
use the unknown IR controller
should be placed close to the
analyser’s receiver IC before a com-
mand key is pressed. The microcon-
troller will decode the message and
display information indicating the
26
Elektor Electronics
10/2001
855734776.212.png 855734776.223.png 855734776.234.png 855734776.244.png
TEST &MEASUREMENT
ted so it’s a good idea to carry a few spares
with you.
Some of the more modern remote con-
trollers will send out two messages each time
a key is pressed. The first message is in one
format while the second message contains
the same information in a different format.
The analyser will only display the last mes-
sage format sent.
Hardware
There are no surprises in the circuit diagram of
the IC code analyser shown in Figure 3 .
The infra red signal is detected by IC2. Infi-
neon have ceased production of their receiver
IC but any one of the compatible devices
specified in the parts list would be suitable.
This device contains a highly sensitive infra
red receiver, amplifier, filter and demodulator
tuned to an IR carrier frequency of 36 kHz. A
data sheet for this device can be down
loaded from:
( www.infineon.com/cmc_upload/0/000/
008/562/sfh5110.pdf ).
The inverted demodulated received signal is
connected directly to an input port of the
microcontroller IC1. IC2 is relatively sensitive
to supply rail disturbances so R2 and C2 are
used to form a low pass filter, decoupling any
interference.
The core of the microcontroller is based on
the Intel 51 architecture that lends itself to
simple low-cost program development by
using any of the available Shareware devel-
opment tools. The 87LPC764 is produced by
Philips and is described as a Low power, low
price, low pin count microcontroller. Decoding
Figure 1. Flash mode signal (a) modulated mode signal at 36 kHz (b).
protocol used and the command
sent. A good source of detailed infor-
mation about the different IR proto-
col formats can be found in the
March and April 2001 edition of Elek-
tor Electronics.
This analyser is only suitable for
decoding modulated signals in the
range of 30 - 40 kHz. Fortunately all
the common control protocols use
this frequency range.
Some (older) controllers use flash
mode where the message informa-
tion is conveyed by switching on the
sender diode for a short period
rather than modulating it at 36 kHz
(see Figure 1 ). The analyser’s IR
receiver chip will only respond to
modulated signals so that flash
mode messages will be ignored.
shown on the display.
2. Key press: Command
This hexadecimal value indicates the
type of command that was sent in
the message. A 10 hex (16 dec ) for
example in RC5 coding indicates
that the command will increase vol-
ume of the controlled equipment.
3. Key press: Complete code
The contents of the entire message
are displayed in hexadecimal. The
hex value assumes that the data is
sent in the order Bit 7 to Bit 0. Some
manufacturers (e.g. Sony) however
reverse the bit order. In this case the
values are corrected before display.
4. Key press: Type of Code
This displays the protocol type of the
last received message e.g. RC5,
SIRCS or RECS80.
When the display shows
UNKNOWN this indicates that the
received message does not conform
to any of the eight standard proto-
cols. It could also indicate however
that the signal was too weak or too
distorted. The IR receiver IC2 is opti-
mised for reception of a 36 kHz mod-
ulated signal so its sensitivity to
some signal protocols at the
extremes of the 30-40 kHz band will
be greatly reduced (see Figure 2 ).
Always place the output diode of the
handheld controller as close as pos-
sible to IC2 of the analyser to ensure
a good signal. LED D2 will blink to
indicate signal reception irrespective
of the type of protocol so it gives a
good indication that the controller is
sending out a signal. If the diode
does not blink try a new set of bat-
teries in the controller. Items at car
boot sales rarely have batteries fit-
Operation
Once the analyser is switched on the
message ‘CODE ANALYSER VER 1‘
will be displayed and then ‘WAIT-
ING...‘ indicating that the analyser is
ready and waiting to receive an IR
controller message. As soon as a
message is received the analyser
will display the type of coding sent
by the controller and pressing push-
button S1 will display further infor-
mation about the received message.
1. Key press: Address
This hexadecimal value indicates the
type of equipment that the controller
was originally designed to control.
As an example, if the controller uses
RC5 protocol format and the address
0 is displayed this indicates that
controller will control a TV. Some
manufacturers do not use the
address field in the message so in
this case two lines (—) will be
Figure 2. The sensitivity of the IR receiver falls
off sharply either side of its centre frequency.
10/2001
Elektor Electronics
27
855734776.001.png 855734776.012.png 855734776.023.png 855734776.034.png 855734776.045.png 855734776.056.png 855734776.067.png 855734776.078.png
 
TEST &MEASUREMENT
Power for the analyser is provided
by a 9 V battery and zener diode D1
regulates this on-board to 5 V. Resis-
tor R1 limits the supply current and
overall consumption is approxi-
mately 20 mA.
9V
+5V
R1
220
+
20mA
P1
R4
R2
R3
K1
10k
VSS
VDD
Vo
RS
R/W
E
D0
D1
D2
D3
D4
D5
D6
D7
D1
C1
10 µ
16V
D2
C2
5V1
Display
The display is a standard 1x16 LCD
(indicating 1 row of 16 characters).
This display is a standard item from
many manufacturers. It has a built-
in controller using a standard com-
mand set. All of the compatible dis-
plays mentioned in the parts list
have identical pin-outs, RAM
addresses and multiplex rate. The
information generated by this
analyser could be displayed on a four
line LCD but to reduce costs it was
decided to employ a single line dis-
play and use a pushbutton to toggle
through the information. The display
control software is simplified by
using eight controller port pins. P1 is
a variable resistor, allowing adjust-
ment of the display contrast.
15
100
µ
16V
12
1
P1.0
P0.0
P0.1
P0.2
P0.3
P0.4
P0.5
P0.6
P0.7
11
20
19
18
17
16
14
13
P1.1
IC1
10
IC2
1
P1.2
9
P1.3(INT0)
3
8
P1.4(INT1)
4
P1.5
87LPC764
3
SF H505 A
2
P1.6
SFH505A
2
P1.7
Dot Matrix
Display
1 x 16
X1
X2
5
6
7
X1
S1
C3
6MHz
C4
1
3
2
0
15p
15p
010029 - 11
Figure 3. Only two IC’s are used in the analyser circuit diagram.
the IR message is relatively processor inten-
sive so a clock rate of 6 MHz is used for the
microcontroller giving a machine cycle of
1
s. The main features of this
processor are summarised under the
heading ‘microcontroller’.
µ
Software
All the relevant data for the follow-
ing protocols are integrated into the
software so that they can be
matched to the incoming signal:
JAPANESE NEC RC5 RECS80
SIRCS DENON DAEWOO
MOTOROLA
The software starts its analysis of
the incoming signal by measuring
the first low-phase. Almost all of the
protocol formats have different
length start bits so this simplifies the
identification process. All of the
incoming signal time measurements
are made using the microcontrollers
timer, this gives a maximum resolu-
tion of 1 ms with the 6 MHz clock
frequency. After the start bit that
usually consists of a low followed by
a high of predefined length the
microcontroller decides how the
incoming data will be stored in the
internal registers. The message
length will depend on the type of
protocol and can be from 11 bits for
RCS80 protocol up to 48 bits for
Japanese coding. The timing toler-
ance of the message length is taken
into account and the length of each
bit is measured and compared to its
limit values.
The Software, including source
Figure 4. An NEC coded signal (used by Harman/Kardon or Yamaha).
28
Elektor Electronics
10/2001
855734776.099.png 855734776.110.png 855734776.121.png 855734776.132.png 855734776.143.png 855734776.154.png 855734776.165.png 855734776.176.png 855734776.179.png 855734776.180.png 855734776.181.png 855734776.182.png 855734776.183.png 855734776.184.png 855734776.185.png 855734776.186.png 855734776.187.png 855734776.188.png 855734776.189.png 855734776.190.png 855734776.191.png 855734776.192.png 855734776.193.png 855734776.194.png 855734776.195.png 855734776.196.png 855734776.197.png 855734776.198.png 855734776.199.png 855734776.200.png 855734776.201.png 855734776.202.png 855734776.203.png 855734776.204.png 855734776.205.png 855734776.206.png 855734776.207.png 855734776.208.png 855734776.209.png 855734776.210.png 855734776.211.png 855734776.213.png 855734776.214.png 855734776.215.png 855734776.216.png 855734776.217.png 855734776.218.png 855734776.219.png 855734776.220.png 855734776.221.png 855734776.222.png 855734776.224.png 855734776.225.png 855734776.226.png 855734776.227.png 855734776.228.png 855734776.229.png 855734776.230.png 855734776.231.png 855734776.232.png 855734776.233.png 855734776.235.png 855734776.236.png 855734776.237.png
 
TEST &MEASUREMENT
code is available free of charge from
the Elektor Electronics website or
alternatively can be ordered (at nom-
inal cost) on diskette 010029-11 . If
you are planing to modify or cus-
tomise the software it should be
noted that the pulse width of the
received IR signals varies quite sub-
stantially with received signal
strength so the decoding software
should be correspondingly tolerant.
The following table gives a practical
example of pulse tolerances for the
signal shown in Figure 4 (NEC code
from Harman/Kardon or Yamaha):
1. Low phase:
8700 - 9200 ms
1. High phase:
4352 - 4607 ms
Second low phase:
400 - 767ms
Gap between low phases:
0-Bit: 400 - 767 ms
1-Bit: >767 ms
The relatively large tolerances often
correspond to the high byte value of
the 16 bit timing counter so that the
hex calculations can be simplified by
ignoring the least significant eight
bits of the timing counter.
Construction
The PCB layout is shown in Figure 5.
The board shown is unfortunately
not available ready-made through
our Readers Services, so you have to
make it yourself. Microcontroller IC1
is fitted to the PCB using a 20 pin
DIP socket. The IR receiver (IC2)
shown is the Infineon type but other
compatible types given in the parts
list can be fitted. The compatible
types have similar performance but
not identical pin-outs so extra
mounting pads on the PCB enable
these other types to be accommo-
dated (just double-check the pin-outs).
The LCD is connected to the PCB via a
short length of ribbon cable. The displays
given in the parts list have a 1:1 pin to pin
compatibility with the PCB layout. Other
types of displays can be used but you will
need to study the corresponding data sheet
to ensure correct signal connections. Once
the circuit has been given a functional test it
can be mounted together with the 9 V battery
in a suitable case. If a transparent case is
used it will only be necessary to drill two
holes in the case, one for the on/off switch
and one for the mode switch. The display will
be visible through the case.
COMPONENTS LIST
Resistors:
R1,R2 = 220
R3 = 1k
2
R4 = 100k
P1 = 10k
preset H
Capacitors:
C1 = 10µF 16V radial
C2 = 100µF 16V radial
C3,C4 = 15pF
(010029-1)
Semiconductors:
D1 = zener diode 5V1, 1 W
D2 = LED, high-efficiency, red
IC1 = 87LPC764 (programmed,
order code 010029-41 )
IC2 = SFH505A (TSOP1736,
SFH5110-36, PIC26043SM,
IS1U60, TFMS5360)
010029-1
(C) ELEKTOR
C1
0
D1
X1
R1
+9V
C2
C4
C3
S1
Miscellaneous:
K1 = 14-way flatcable
S1 = push-button, 1 make contact
X1 = 6MHz quartz crystal
Dot matrix display, 1 x 16 charac-
ters (MCC161A1-4, MCC161A2-
3(Truly), LM161556 (Sharp)
9V battery with clip
Enclosure (Heddic 222)
On/off switch
IC1
D2
P1
K1
010029-1
Figure 5. The crystal needs to be mounted flat on the PCB
(board not available ready-made).
10/2001
Elektor Electronics
29
855734776.238.png 855734776.239.png 855734776.240.png 855734776.241.png 855734776.242.png 855734776.243.png 855734776.245.png 855734776.246.png 855734776.247.png 855734776.248.png 855734776.249.png 855734776.250.png 855734776.251.png 855734776.252.png 855734776.253.png 855734776.254.png 855734776.002.png 855734776.003.png 855734776.004.png 855734776.005.png 855734776.006.png 855734776.007.png 855734776.008.png 855734776.009.png 855734776.010.png 855734776.011.png 855734776.013.png 855734776.014.png 855734776.015.png 855734776.016.png 855734776.017.png 855734776.018.png 855734776.019.png 855734776.020.png 855734776.021.png 855734776.022.png 855734776.024.png 855734776.025.png 855734776.026.png 855734776.027.png 855734776.028.png 855734776.029.png 855734776.030.png 855734776.031.png 855734776.032.png 855734776.033.png 855734776.035.png 855734776.036.png 855734776.037.png 855734776.038.png 855734776.039.png 855734776.040.png 855734776.041.png 855734776.042.png 855734776.043.png 855734776.044.png 855734776.046.png 855734776.047.png 855734776.048.png 855734776.049.png 855734776.050.png 855734776.051.png 855734776.052.png 855734776.053.png 855734776.054.png 855734776.055.png 855734776.057.png 855734776.058.png 855734776.059.png 855734776.060.png 855734776.061.png 855734776.062.png 855734776.063.png 855734776.064.png 855734776.065.png 855734776.066.png 855734776.068.png 855734776.069.png 855734776.070.png 855734776.071.png 855734776.072.png 855734776.073.png 855734776.074.png 855734776.075.png 855734776.076.png 855734776.077.png 855734776.079.png 855734776.080.png 855734776.081.png 855734776.082.png 855734776.083.png 855734776.084.png 855734776.085.png 855734776.086.png 855734776.087.png 855734776.088.png 855734776.089.png 855734776.090.png 855734776.091.png 855734776.092.png 855734776.093.png 855734776.094.png 855734776.095.png 855734776.096.png 855734776.097.png 855734776.098.png 855734776.100.png 855734776.101.png 855734776.102.png 855734776.103.png 855734776.104.png 855734776.105.png 855734776.106.png 855734776.107.png 855734776.108.png 855734776.109.png 855734776.111.png 855734776.112.png 855734776.113.png 855734776.114.png 855734776.115.png 855734776.116.png 855734776.117.png 855734776.118.png 855734776.119.png 855734776.120.png 855734776.122.png 855734776.123.png 855734776.124.png 855734776.125.png 855734776.126.png 855734776.127.png 855734776.128.png 855734776.129.png 855734776.130.png 855734776.131.png 855734776.133.png 855734776.134.png 855734776.135.png 855734776.136.png 855734776.137.png 855734776.138.png 855734776.139.png 855734776.140.png 855734776.141.png 855734776.142.png 855734776.144.png 855734776.145.png 855734776.146.png 855734776.147.png 855734776.148.png 855734776.149.png 855734776.150.png 855734776.151.png 855734776.152.png 855734776.153.png 855734776.155.png 855734776.156.png 855734776.157.png 855734776.158.png 855734776.159.png 855734776.160.png 855734776.161.png 855734776.162.png 855734776.163.png 855734776.164.png 855734776.166.png 855734776.167.png 855734776.168.png 855734776.169.png 855734776.170.png 855734776.171.png 855734776.172.png 855734776.173.png 855734776.174.png 855734776.175.png 855734776.177.png 855734776.178.png
 
Zgłoś jeśli naruszono regulamin