Consumer Infrared on the iPAQ Pocket PC
Home Downloads Contact


Update 16th October 2001.

OK - I will be working on this project again very soon.

I have created a mailing list you can join if you want to contribute to this project.
Just send a message to majordomo@kean.com.au with a message body of "subscribe infrared"

Revised 9th September 2001.
(Due to serious illness in my family I haven't been able to do much further work on this in the last two months - I am sure all of you understand.)

NEWSFLASH: A helpful reader has pointed out that there is a site with a shareware "TV remote controller" program for the iPAQ at www.pdawin.com (many thanks to Bart Pelgrims).  I haven't tried this out yet - if any of you do, please update me on how you go.

- Kean.


Preface

I have spent a few months working (and playing) with my iPAQ, and (probably like you if you are reading this) have been wondering if I can get it to act as a remote control to replace the clutter of devices on the coffee table.

This will be a technical discussion, so before I start let me tell you my relevant qualifications.  I have over 15 years hardware and software experience with microprocessors/digital electronics.  I am not an expert on Consumer Infrared (or IrDA), but I have written programs (during the last 10 years) to receive, record and decode remote control signals under DOS and for 8 bit micro-controllers.

If you notice any errors in this document (or have suggestions for improvement) let me know.  No responsibility is taken for any errors, or any damage you may cause to equipment using the information provide here.

Introduction

First, let me tell you about the most common types of IR:

CIR = "Consumer Infrared"
- Used by electronics manufacturers in devices like TV, VCR, Hi-Fi, DVD, etc.
- De-facto standard ?
- Different frequencies of transmission, and various formats.
- Typically modulated at approx 35 to 40 kHz (38kHz is common).
- See below for some samples of what these signals look like.

SIR = "Slow Infrared"
- Originally developed by HP for device-to-device communication, and included a part of the IrDA standard.
- Provides baud rates up to 115kbps.
- Transmission uses short pulses (3/16 bit time, minimum 1.6uS) to designate logic 0.

FIR = "Fast Infrared"
- IrDA Standard at 4Mbps.
- Uses a time-slot encoding system, with 4 different "slots" per "chip".

Now, about the iPAQ hardware:

- Intel Strongarm SA-1110 CPU.
- CPU includes 4 serial ports.
- Serial port 2 is used to drive Infrared transceiver.
- CPU includes on-chip logic on serial port 2 for IrDA.

There isn't much written by Compaq about the IR hardware in the iPAQ.  That is to say, there isn't a lot of publicly available technical info.  The main source of info, the iPAQ Hardware Design Specifications (see below for link) specifically state...

"The iPAQ H3600 does not support the consumer IR standard."

There may be any number of reasons for Compaq to state this...  I won't speculate further here.  Let's just try to make it work on our own.

Results so far

I am still working on it...

It has been great to have feedback on this from a few readers.  Please

I have tried:

- Using WinLIRC to record and decode remote control signals on my PC, using a home made serial port based IR receiver.

- Using Microsoft eMbedded Visual C, I wrote a test program that uses serial transmission, and "EscapeCommFunction" to generate UART break transmission switched at a fixed frequency, in an attempt to see if it is possible to simulate the 40kHz modulation. Due to recent USB problems on my PC, I haven't yet tried this with my new IR Scope mentioned below.

- Using a 5MHz analogue Oscilloscope to review signals transmitted by devices.

- Created a special version of WinLIRC containing the ability to capture the IR signal and view it in "Scope" mode.  This is an extension of the existing WinLIRC "Raw" mode, but is much more useful in getting a picture of what is happening.

Here is a capture of the IR output of my Sanyo RB-MS5 Remote control (volume up button I think).  It gives you a good feeling for what CIR signals look like.  Most manufacturers have their own encoding schemes, involving different modulation frequencies, different pulse/gap timing, different bit patterns, and various error checks, but most look something like this.

In actual fact the signal is modulated at approx 40kHz, so each of the peaks is actually transmitted as a rapidly flickering infrared light, and the valleys are the absence of the flickering infrared.  The better CIR receivers are "tuned" to this frequency, and so filter out most stray infrared light, and just output a clean binary signal.  I use the Sharp GP 1U5 receiver that is sold by Radio Shack, and used a lot on hobby robots for proximity detection.

BUT... this is where I believe we may come unstuck with the iPAQ hardware!

Here is another capture, but this time it is of the IR signal sent by my iPAQ when using the Windows CE "Infrared Receive" program.  As you can see, WinLIRC sees the transmission happily with the CIR receiver which is tuned to modulation frequency of approx 40kHz.

This is (probably) good news!

I qualified that with probably because the modulation may just be "close enough" to trick the IR receiver I am using, but may not in the end work with an specific consumer device.  And I am not sure that the above signal is actually what was transmitted.. but it was reproducable.

I think the initial IrDA negotiation is at 9600 baud, but I haven't check the timing of these pulses yet.  This can be done using the "Raw" viewing mode in WinLIRC, and possibly in "Scope" mode in the next update to my version.  (Note the Zoom factor shown is relative to the capture size, not the frequency... so this doesn't mean much, only affecting the scope display.)

Next, I hope to try:

- Encoding the data as a bit-stream that can be transmitted by the UART, using a specially calculated baud rate or break transmission appropriate to get the necessary modulation frequency.  This may still not work because of the inability to control the duty cycle of the output - fixed at 3/16th baud rate - or quite possibly this will just affect the "strength" of our output.  I think it is set up this way to reduce battery consumption.

- Map the SA-1110 control registers into virtual memory, disable serial port 2 UART, and manually toggle the I/O pins.  I haven't tried this due to time, and reluctance to loose data on, or possibly damage, my iPAQ.  There is some sample code to look at on handhelds.org in the syswatch and osloader W
indowsCE apps.  (See the files osloader/APhysicalMemoryBlock.cpp and syswatch/ADeviceState.cpp et al)

I have located a DSO (Digital Storage Oscilloscope) through a friend, so I soon be able to see the actual nature of the IR transmissions (particularly the actual modulation) as generated by the iPAQ.

Sample Programs

See the Downloads section.

References

- Compaq iPAQ Hardware reference
- Intel StrongARM SA-1110 Developers Manual
- IrDA Standard
- Infrared HOW-TO (lots of ideas here, but not much practical to apply to the iPAQ)
- LIRC - Linux IR Control project
- WinLIRC - Windows port of LIRC
- handhelds.org - linux port for the iPAQ by Compaq - has some iPAQ tech docs
- Decoding IR Remote Controls

© 1997-2001 Kean Electronics. Last updated: 12 November 2001
Hits since 26 April 2001: