Saturday, September 27, 2014

Fun with irDA

Recently, I picked up a fun little bit of kit that consists of a small irDA remote and an irDA receiver.

I did a bunch of reading about irDA remote controls and it is a bit mind boggling.  It is clear that there is a bunch of legacy junque that has been drug along for years in the implementation of irDA remote controls.  The little breakout board with the irDA receiver on it kindly includes a visible light LED that toggles in response to anything the sensor sees.  This makes it easy to verify that it is seeing your remote control.

Taking at look at the output from the sensor on the scope we see this kind of information being transmitted for one of the buttons on the remote.

There are a bunch of different encodings for these remote controls and I had no interest in determining exactly what code format this remote uses.  I did find an Arduino library or ten that would decode the data stream.  With that in hand, I was able to find the codes for all the buttons on the remote, listed below top/left to bottom/right.

Power        - 0xffa25d
Mode         - 0xff629d
Mute         - 0xffe21d
Play         - 0xff22dd
Rewind       - 0xff02fd
Fast Forward - 0xffc23d
EQ           - 0xffe01f
Minus        - 0xffa857
Plus         - 0xff906f
0            - 0xff6897
Random       - 0xff9867
U/SD         - 0xffb04f
1            - 0xff30cf
2            - 0xff18e7
3            - 0xff7a85
4            - 0xff10ef
5            - 0xff38c7
6            - 0xff5aa5
           - 0xff42bd
           - 0xff4ab5
           - 0xff52ad

So, with all this fun in mind, I decided to set up the irDA remote to work with Minima.  I added the code to initialize the irDA receiver and in the btnDown function added receiving the button codes above and mapping them to Minima's 7 button scheme implemented by Eldon, WA0UWH.  For now, I just mapped the buttons as follows:

Mode -- FN (button 1)
Rewind - Left (button 2)
Fast Forward - Right (button 3)
Minus - Down (button 6)
Plus - Up (button 5)

So, with this simple change, I am able to move the cursor to select the frequency digit to change, move up and down through the ham band select and toggle RIT mode.  It would be simple enough to add direct frequency entry and map the rest of the buttons.

This is just a proof of concept bit of fun on a Saturday afternoon when I should really be out playing in the sun before it runs away and hides for the rest of the year...

Here is the Minima controller shield mounted on an ATMega2560 with the irDA breakout board jumpered to digital pin 3.  The display is an i2c 20x4 LCD on my Minima front panel.

No comments:

Post a Comment