[En-Nut-Discussion] infrared connections

Alex Hay alex.h at lfiinternational.com
Wed Jan 11 04:52:23 CET 2006


Ernst and Michael,

I needed to implment an IR receiver for a protocol similar to RC-5 for a
recent project, and I was initially intimidated.  I had allocated a week and
a half to implement the IR receiver, having read a few notes and looked at
some sample code.  I was pleasantly surprised when I had code up and running
in about 12 hours!

I basically used the information (specifically the timing and state machine
information) from http://www.clearwater.com.au/rc5/ to make it work.  That
page references some source code but I found it easier to implement my own.
In my Cypress PSoC I set up a hardware counter with an interrupt on its
terminal count, and a GPIO pin with an interrupt on state change.  The IR
detector (a module with a built-in 36-kHz filter) is attached to the GPIO
pin.  The timer is loaded with a value that makes it expire and throw an
interrupt after a time period that's slightly greater than a long event
(long space or long pulse).  When the system starts up, the counter is
disabled.  The first state change on the GPIO pin enables the counter, and
each additional state change causes an interrupt which reads the counter and
then resets it -- the elapsed time determines the system state and the value
of the bit of data being transmitted, according to the aforementioned state
machine.  When the last bit of the IR stream has been emitted the timer will
time out, tripping a separate ISR; this ISR stops the timer, confirms that
the received data is valid, and raises a system flag if the data is good.

I'd be happy to share my code, except that it really wouldn't work for you:
apart from being poorly written (I'm not really a programmer) it is for a
custom protocol which is slightly different from RC-5, using more bits and a
different data framing format.  But I want to assure you that decoding RC-5
is not NEARLY as difficult as it sounds when you first read about it, and
I'd imagine you'd get something running in no more than a day or two if you
tried.

Best Regards,

-Alex

---------------------------------

  Alex Hay
  Director of Engineering
  alex.h at lfiinternational.com

  LFI International
  13221 SE 26th Street, Suite H
  Bellevue, Washington 98005
  U.S.A.

  (425) 644-2777 Voice
  (425) 644-0330 FAX

  www.lfiinternational.com

  "Create the Experience"

---------------------------------

> -----Original Message-----
> From: en-nut-discussion-bounces at egnite.de
> [mailto:en-nut-discussion-bounces at egnite.de]On Behalf Of Michael Kirsten
> Sent: Tuesday, January 10, 2006 1:32 PM
> To: Ethernut User Chat (English)
> Subject: Re: [En-Nut-Discussion] infrared connections
>
>
> Hi Ernst,
>
> I tried to connect an infrared receiver to my Ethernut 2.0 Board
> but, I didn´t
> suceed in getting it to work.
>
> I used an old Actisys IR210 Receiver / Transmitter that was
> connected to a
> motherboard (Tyan S1598).
> That thing had everything included in one case and had TTL I/O for
> IR-Receive / Transmit.
>
> I quit trying when I had to learn that, RC5-Code is not so easy
> to implement
> for a "sunday afternoon programmer" that I am.
>
> Regards
>
> Michael
>
> Am Dienstag, 10. Januar 2006 22:18 schrieb Ernst Stippl:
> > Hi!
> >
> > In my home, I want to control windows (open/close & blinds
> up/down) - which
> > came with infrared remote controls - from an Ethernut-based central
> > "control station". Has anybody connected I/R
> transmitter/receiver Leds to
> > Ethernut 2 so far?
> >
> > Regards
> >
> > Ernst
> >
> > _______________________________________________
> > En-Nut-Discussion mailing list
> > En-Nut-Discussion at egnite.de
> > http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>




> -----Original Message-----
> From: en-nut-discussion-bounces at egnite.de
> [mailto:en-nut-discussion-bounces at egnite.de]On Behalf Of Michael Kirsten
> Sent: Tuesday, January 10, 2006 1:32 PM
> To: Ethernut User Chat (English)
> Subject: Re: [En-Nut-Discussion] infrared connections
>
>
> Hi Ernst,
>
> I tried to connect an infrared receiver to my Ethernut 2.0 Board
> but, I didn´t
> suceed in getting it to work.
>
> I used an old Actisys IR210 Receiver / Transmitter that was
> connected to a
> motherboard (Tyan S1598).
> That thing had everything included in one case and had TTL I/O for
> IR-Receive / Transmit.
>
> I quit trying when I had to learn that, RC5-Code is not so easy
> to implement
> for a "sunday afternoon programmer" that I am.
>
> Regards
>
> Michael
>
> Am Dienstag, 10. Januar 2006 22:18 schrieb Ernst Stippl:
> > Hi!
> >
> > In my home, I want to control windows (open/close & blinds
> up/down) - which
> > came with infrared remote controls - from an Ethernut-based central
> > "control station". Has anybody connected I/R
> transmitter/receiver Leds to
> > Ethernut 2 so far?
> >
> > Regards
> >
> > Ernst
> >
> > _______________________________________________
> > En-Nut-Discussion mailing list
> > En-Nut-Discussion at egnite.de
> > http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>






More information about the En-Nut-Discussion mailing list