Beruflich Dokumente
Kultur Dokumente
com
Visit us at http://www.sunrom.com
Board Schematic
U1
TSOP1738
GND
VCC
+5V
IR
U2
ST3617
3
2
1 8
2 VDD GND 7
3 IR DAT 6 CN1
TXD CLK 5 +5V +5V
4 SIP3
C1 N/C RDY 3
100nF TXD 9600 bps serial data 2 +
S
1
-
Features of Protocol
Modulation
RC5 Modulation The protocol uses bi-phase modulation (or so-called Manchester coding) of a
36kHz IR carrier frequency. All bits are
of equal length of 1.778ms in this
protocol, with half of the bit time filled
with a burst of the 36kHz carrier and the
other half being idle. A logical zero is
represented by a burst in the first half of
the bit time. A logical one is represented by a burst in the second half of the bit time. The
pulse/pause ratio of the 36kHz carrier frequency is 1/3 or 1/4 which reduces power consumption.
Protocol
The drawing below shows a typical pulse train of an RC-5 message. This example transmits
command $35 to address $05.
The first two pulses are the start pulses, and are both logical "1". Please note that half a bit time is
elapsed before the receiver will notice the real start of the message.
The next 5 bits represent the IR device address, which is sent with MSB first. The address is
followed by a 6 bit command, again sent with MSB first.
A message consists of a total of 14 bits, which adds up to a total duration of 25 ms. Sometimes a
message may appear to be shorter because the first half of the start bit S1 remains idle. And if the
last bit of the message is a logic "0" the last half bit of the message is idle too.
As long as a key remains down the message will be repeated every 114ms. The toggle bit will retain
the same logical level during all of these repeated messages. It is up to the receiver software to
interpret this auto repeat feature.
Example
For example pressing Key 1 on remote control can output 0x3001 where 0x30 is high byte and 0x01
is low byte.
The Address bits A0 to A4 are zero since TV remote has zero RC5 address.
The Command bits D0 to D5 are 0x01 since User has pressed Key1 and value of key1 is 1.
Serial Data Output Format
When you see data output from chip in serial at 9600 baud rate, you will get total six bytes output as
each key press in ASCII format so you can view it on screen.
Let us see what data output you will get in serial mode. The last two bytes in serial mode are new
line characters so that when you see this data in terminal you can see each new data in new line. If
you press Key1 on remote, you will get following output
The above values in serial data are ASCII characters. You can convert the value to binary to use in
your program by deducting 0x30 from ASCII value. Our sample code given on next page uses this
technique to convert this ASCII buffer of four digit to single integer of RC5 data variable containing
16 bits.
U6 1
16
MAX232 6
GND
+5V
11 14 2
VCC
9 T1IN T1OUT 8 7
12 R2OUT R2IN 13 3
3
2
1
10 R1OUT R1IN 7 8
T2IN T2OUT 4
+
1
C+ C2+
4
+
9 http://www.sunrom.com/p-245.html
5
C13 C12
10uF 16V 3 5 10uF 16V
VCC C1- C2-
GND
2 6
V+ V-
+ C15
15
C14
+
10uF 16V
10uF 16V
VCC
RS232 INTERFACING
TX-OUT
RX-IN
GND
GND
+5V
+5V
3
2
1
1
2
3
4
USB INTERFACING
It will appear as virtual serial port on PC to which you can
You can use our
communicate through any software which can transmit
USB to Serial Board
receive by this serial port like hyperterminal or
Model 1151
custom made software.
To get +5V power for RC5 Decoder from
USB port, solder +5V wire of RF module
to +ve pin of this capacitor.
http://www.sunrom.com/p-244.html
U6 C2 +5V
TSOP1738
100n U4
40
AT89C51
21 39
GND
VCC
VCC
+5V 22 P2.0/A8 P0.0/AD0 38
IR
U5 23 P2.1/A9 P0.1/AD1 37
ST3617 24 P2.2/A10 P0.2/AD2 36
3
2
1 8 25 P2.3/A11 P0.3/AD3 35
2 VDD GND 7 26 P2.4/A12 P0.4/AD4 34
3 IR DAT 6 27 P2.5/A13 P0.5/AD5 33
TXD CLK 5 +5V P2.6/A14 P0.6/AD6
4 28 32
C3 N/C RDY P2.7/A15 P0.7/AD7
100nF TXD 9600 bps serial data 10 1
11 P3.0/RXD P1.0/T2 2
12 P3.1/TXD P1.1/T2EX 3
13 P3.2/INT0 P1.2 4
14 P3.3/INT1 P1.3 5
CN1 +5V 15 P3.4/T0 P1.4/SS 6
PBT3 LS1 16 P3.5/T1 P1.5/MOSI 7
RELAY 17 P3.6/WR P1.6/MISO 8
5 D1 P3.7/RD P1.7/SCK
3 1N4007 31 +5V
4 29 EA/VPP
1 30 PSEN C5
2 R2 ALE/PROG 10uF 16V
1K 9
XTAL2
XTAL1
Q1 RST
GND
BC547
R1
10K
18
19
20
Y1
C8 11.0592 C7
33p 33p