Path: Home =>
AVR-overview =>
IR Remote Control => Measure control signals
Analysis of IR remote control devices with an AVR ATmega8
This page demonstrates, how
- the signals of a remote control device are designed,
- the hardware for measuring them is designed,
- the software works,
- the measuring results are read out,
- the measured data can be analysed.
To better discriminate remote control signals from other IR sources, such as
light and heat generation, these signals are modulated. Remote control signals
look like this:
The duration of active and inactive states, the signal sequence, is specific for
each remote control device, every producer has its own formula and design. Here
are thousands of opportunities to make a difference, so don't wonder why all your
different boxes don't interfere with any other device in your living room.
To the top of page, To the IR main page
I used the STK500 for measuring and did not build up an own device for that
purpose because the measuring is done only once and is not needed contineously.
As IR sensor a TSOP1738 from Vishay Telefunken is used. This small device is
placed into a socked, which is wired and connects via pin plugs to Port D of
the STK500 (red=VTG, black=GND, gray=PD2).
As processor a ATmega8 is used that is inserted into the socket SCKT3200A2
of the STK500 and is programmed via the green ISP plug.
The RS232 lines RXD and TXD are connected with Port D PD0 and PD1. On the
SPARE connector, the RS232 signal can be connected with a computer.
The clock signal is generated with a Xtal of 9.8304 MHz, the jumpers and
the ATmega8 fuses have to be set according to this.
To the top of page, To the IR main page
The software for the ATmega8 is in HTML format here
and in in asm format here available.
The software
- watches the INT0 input for every level change and reacts to those,
- takes over the counter value of a 24-bit-timer, adds in the highest bit
the information that the signal was high (1) or low (0),
- stores this into a buffer in SRAM,
- converts this time info into decimal and sends this info with a leading
"H" resp. "L" with 38.400 Bd over the serial interface,
- allows starting and stopping of the measurements (by sending a 1 or 0 over
the serial interface),
- allows to change the timebase for measuring (by sending a, b, c or d
over the serial interface).
Send and receive over the serial interface are handled interrupt-driven to
avoid interference with measuring signal durations.
To the top of page, To the IR main page
The measured data doesn't have to be copied using paper and pencil. When using
a brandnew and top-rated operating system like Windows 7, reading the data to
a simple text file nowadays is a rather complicated issue. Because there is
no free and functioning terminal program with a simple capture mode any more.
It seems that operating systems today don't need this any more, ancient
technologies!
I have found one for free, but it doesn't run on a W7-64bit. So I downloaded
and installed a virtual PC and the WinXP of M$ first (a very intensive task).
Then I downloaded RealTerm frtom the internet and installed it inside
VirtualXP. Before starting RealTerm the serial interface to the SPARE
connector of the STK500 has to be plugged, in my case via a serial-to-USB
device, and the USB connection has to be allocated to the VirtualXP.
In the RealTerm window the serial port (here: port 3) has to be assigned, as
baudrate 38,400 selected and the button Change to be pressed.
The ATmega8 displays his menu.
The data of high- and low-phases in mode A is measured with a 10 µs clock.
The window Capture in RealTerm allows to download the data of a remote control
device to a text file. In order to do this, a filename has to be selected and
Capture is started with the button. To collect all data of a remote control
device in one file, you should input a name for the key first (by moving the
cursor into the transmitting window of RealTerm and typing "key=xyz"
and CarriageReturn).
So that is how this logged data looks like in your text file.
To analyse this data in a comfortable way I have written a piece of software.
Here you find a description and the
software.
To the top of page, To the IR main page
©2011 by http://www.avr-asm-tutorial.net