Newsgroup: sci.electronics


Article 20601 of sci.electronics:
Newsgroups: sci.electronics
Path: icdoc!dds
From: dds@doc.ic.ac.uk (Diomidis Spinellis)
Subject: Re: Seeking IR remote control specifications
Nntp-Posting-Host: skid.doc.ic.ac.uk
Message-ID: <1992Jan5.174122.29726@doc.ic.ac.uk>
Organization: Dept. of Computing, Imperial College, London, England
Date: Sun, 5 Jan 1992 17:41:22 GMT
References: <1992Jan2.200610.18596@ntg.com> <brianv.0z6r@amiganet.chi.il.us>
Lines: 194
Content-Length: 6063
In article <brianv.0z6r@amiganet.chi.il.us> brianv@amiganet.chi.il.us (Brian Vargyas) writes:
>I've been working with the IR stuff for a bit now....
[...]
>Each "sample" appears to have about 52 high/low transitions in it...  If
>properly stored, one could save 153 samples in just 8K of ram....  That's the
>trick, and I havn't mastered it yet!    The trick to having a clean quick
>system is to capture only ONE of the samples, since pressing and holding a key
>on your remote continously transmits that signal frame multiple times.

In order to decode the keys of the Sony RM-DM1K receiver I used a
pipeline of programs.  A receiver program dumped raw data from the
input port into memory and then to a file.  Another program, `delta'
measured the number of consecutive zero and one bits.  A third program,
`aver'  was built after examining the output of the `delta' program to
classify the pulses into categories and print their average length.
Finaly a fourth program, `dec' was built using the output of the `aver'
program to decode the pulse sequences into bit patterns.  The output
from that program was then converted by hand into a table like the one
that follows.  John DuBois <spcecdt@deeptht.santa-cruz.ca.us> has
posted an article <1992Jan02.032529.1531@deeptht.santa-cruz.ca.us> with
a more flexible table format.  Note that the timings mentioned in the
table do not exactly conform to the Sony control-S specification.  I
have included the three programs at the end of this article.  I think
they are so small that they do not violate the `no source in no source
newsgroups' rule spirit.

#
# Codes of the Sony remote control RM-DM1
#
# The remote sensor RM-DM1K is wired as follows:
# Shield: Ground
# Ring  : 5V
# Tip   : Data
#
# The remote is active high
# The command consists of a 2471us start bit of 1
# 12 data bits which are encoded as follows:
#   A 435us pulse of 0
#   A 726ms pulse of 1 for a zero bit
#   A 1309ms pulse of 1 for a one bit
# A 24.9ms gap of 0
#
# Commands are repeated as long as the key is held down.
#
# The table below contains the key values
# Bits are send with the LSB first, i.e bits are shifted out of the low end

Tuner 1:1664
Tuner 2:1665
Tuner 3:1666
Tuner 4:1667
Tuner 5:1668
Tuner 6:1669
Tuner 7:1670
Tuner 8:1671
Tuner 9:1672
Tuner 10:1673
Tuner off:1711
1:2176
2:2177
3:2178
4:2179
5:2180
6:2181
7:2182
8:2183
9:2184
10:2208
11:2209:*
12:2210:*
13:2211:*
14:2212:*
15:2213:*
+10:2215
Remain:2216:*
Repeat A-B:2218
Repeat all:2220
Off:2223:*
AMS back:2224
AMS forward:2225
Play:2226
Shuffle:2229
Index back:2230:*
Index forward:2231:*
Stop:2232
Pause:2233
Back:2234
Forward:2235
# * Not used by RM-DM1K, but supported by D-250

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	delta.c
#	aver.pl
#	dec.pl
# This archive created: Sun Jan  5 17:36:33 1992
export PATH; PATH=/bin:$PATH
echo shar: extracting "'delta.c'" '(323 characters)'
if test -f 'delta.c'
then
	echo shar: will not over-write existing file "'delta.c'"
else
sed 's/^X//' << \SHAR_EOF > 'delta.c'
X/*
X * Analyse a bit stream into bit length sequences
X */
X#include <stdio.h>
X
Xmain()
X{
X	int c, c2, cb;
X	int length;
X
X	c2 = getchar();
X	while ((c = getchar()) != EOF) {
X		cb = c;
X		if (c != c2) {
X			printf("%c %d\n", c2, length);
X			length = 0;
X			c2 = c;
X		} else
X			length++;
X	}
X	printf("%c %d\n", cb, length);
X	exit(0);
X}
SHAR_EOF
if test 323 -ne "`wc -c < 'delta.c'`"
then
	echo shar: error transmitting "'delta.c'" '(should have been 323 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'aver.pl'" '(820 characters)'
if test -f 'aver.pl'
then
	echo shar: will not over-write existing file "'aver.pl'"
else
sed 's/^X//' << \SHAR_EOF > 'aver.pl'
X#!/bin/perl
X# Print the average values of the pulse lenghts in the bit stream
X$cycle = 1;
Xwhile (<>) {
X	($b, $l) = split(/[ \t\n]+/);
X	if ($b == 1 && $l > 500) {$start += $l; $startc++;}
X	elsif ($b == 1 && $l > 190 && $l < 290) {$zero += $l; $zeroc++;}
X	elsif ($b == 1 && $l > 350 && $l < 450) {$one += $l; $onec++;}
X	elsif ($b == 0 && $l > 7000 && $l < 8000) {$gap += $l; $gapc++;}
X	elsif ($b == 0 && $l > 1000) { ; }
X	elsif ($b == 0 && $l > 70 && $l < 170) {$low += $l; $lowc++;}
X	else { print STDERR "Unknown sequence: $_\n";}
X}
Xprintf("Start bit (1) %gs\n", $start / $startc * $cycle);
Xprintf("Zero length (1) %gs\n", $zero / $zeroc * $cycle);
Xprintf("One length (1) %gs\n", $one / $onec * $cycle);
Xprintf("Repeat gap length (0) %gs\n", $gap / $gapc * $cycle);
Xprintf("Low length (0) %gs\n", $low / $lowc * $cycle);
SHAR_EOF
if test 820 -ne "`wc -c < 'aver.pl'`"
then
	echo shar: error transmitting "'aver.pl'" '(should have been 820 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'dec.pl'" '(400 characters)'
if test -f 'dec.pl'
then
	echo shar: will not over-write existing file "'dec.pl'"
else
sed 's/^X//' << \SHAR_EOF > 'dec.pl'
X#!/bin/perl
X# Convert bit length sequences into decoded words
Xwhile (<>) {
X	($b, $l) = split(/[ \t\n]+/);
X	if ($b == 1 && $l > 500) {print "START ";}
X	elsif ($b == 1 && $l > 190 && $l < 290) {print "0 ";}
X	elsif ($b == 1 && $l > 350 && $l < 450) {print "1 ";}
X	elsif ($b == 0 && $l > 1000) {print "\n";}
X	elsif ($b == 0 && $l > 70 && $l < 170) { ; }
X	else { print STDERR "Unknown sequence: $_\n";}
X}
SHAR_EOF
if test 400 -ne "`wc -c < 'dec.pl'`"
then
	echo shar: error transmitting "'dec.pl'" '(should have been 400 characters)'
fi
fi # end of overwriting check
#	End of shell archive
exit 0
-- 
Diomidis Spinellis                  Internet:                 dds@doc.ic.ac.uk
Department of Computing             UUCP:                    ...!ukc!icdoc!dds
Imperial College, London SW7        #include "/dev/tty"




Newsgroup sci.electronics contents
Newsgroup list
Diomidis Spinellis home page

Creative Commons License Unless otherwise expressly stated, all original material on this page created by Diomidis Spinellis is licensed under a Creative Commons Attribution-Share Alike 3.0 Greece License.