Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!usc!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!cit-vax!tybalt.caltech.edu!madler From: madler@tybalt.caltech.edu (Mark Adler) Newsgroups: comp.sys.handhelds Subject: Re: Easy HP infra-red PC receiver. Message-ID: <13157@cit-vax.Caltech.Edu> Date: 5 Jan 90 23:17:28 GMT References: <5916@sdcc6.ucsd.edu> Sender: news@cit-vax.Caltech.Edu Reply-To: madler@tybalt.caltech.edu.UUCP (Mark Adler) Organization: California Institute of Technology Lines: 65 Yep, I bought one (actually two) of those IR detectors from Radio Shack. I have written code and and have been able to read stuff from the HP. However, there is a problem that I have not overcome. The filter in the detector that picks out the pulses produces a duty cycle that is rather a lot larger than the actual envelope of the signal from the calculator. The result is that for the first few bytes sent, the start bits and one or two bits after that are all run together in a single pulse. This problem clears up after the first few bytes, as the automatic gain built into the detector settles down. From then on, I can receive the bytes with no problem. That is, until the calculator decides to pause to the let the printer catch up. Then the first few bytes that follow are screwed up, since the detector has cranked up its gain since it didn't get any signal that whole time. One hacked up solution to the problem would be to have a special program on the calculator that sends stuff in a continuous stream and sends a few garbage bytes to start with. Do do this, someone would have to tell me what SYSEVAL address sends an encoded byte out the IR port. One possible cause of the problem, is that the IR detector has built in a 40 KHz filter for typical remote controllers which output IR pulses at a 40 KHz rate. The HP-28S, however, uses 32.768 KHz pulses. This doesn't keep the detector from working, since according to the specs, the response is only down by 6 dB at 32 KHz, so this effectively means that the detector has only half the range it would if it were tuned to 32 KHz. No big deal, since you can always put the calculator near the detector. (Though, while experimenting, I put the calculator fifteen feet away, and it still worked fine.) Another side effect is that this makes the detector much more sensitive to "noise" from normal remote controls, so you would not be able to use those in the same room, or even near by rooms while using the link. A solution might be to change one of the external components in the detector, of which there are three: two capacitors and a resistor, all surface mount. I am going to put a variable resistor in place of the one that is there to see what effect it has on the problem. It is also possible that the resistor might control the gain, which could also potentially solve the run-together-bits problem. Another possible solution, which I tried and it didn't work, was to ignore the run together bits (which include the parity bits for error correction), and just extract the data bits. Even had this worked, it would not have been a very good solution since there is no error detection or correction. But it didn't work anyway because sometimes the run together bits preclude deducing what following bits are, since the encoding method uses the last bit to send the next bit. And every once in a while, the run together bits include the data bits. I too was very excited when I hooked this thing up and it looked like it was going to work. I will post notes about progress, or the lack of it, on the detector. Just by the way, I got the IR information from an issue of the HP Journal that I got by calling the technical support number in my calculator manual. Also, I am writing the program in Turbo C 2.0, using __emit__ to produce assembler code without an assembler. I have an assembler, but this way, others without one will be able to modify the program. Wish me luck. Mark Adler madler@hamlet.caltech.edu The opinions expressed here are not, in fact, mine, but rather belong a small worm that lives on the fourth planet out from Betelgeuse.