The Museum of HP Calculators

HP Forum Archive 13

[ Return to Index | Top of Index ]

Ir ... I have an HP Ir question ...
Message #1 Posted by Randy on 3 June 2003, 1:38 p.m.

Now that the HP82240B is long gone, compatible printers are still available new, manufactured by Martel Instruments of England. At martelinstruments.com, check out the MCP8850 and MCP9850 which are versions built to the HP Ir calculator interface. These calculators are available at a US distributor at 800-578-9021 (Current Components Incorporated) for about $170. The print speed and clarity is supposed to exceed that of the old HP printers. Martel also makes versions of these printers with multiple interfaces built in and with different power supply options, but I have not yet found a US distributor of such (MCP8830's). But here's my question: Wouldn't it be nice to use the HP Ir calcultor output to send data directly to a PC? Has anyone done this? Is the little HP Ir to RS232 adapter by Aegis (IR-HP5) for about $40 the answer? All this was probably covered by previous questions and answers here or in those old user groups (or is that groups of old users?), but I thought I would ask again because this forum is such a great brain trust. Any observations on HP Ir issues would be appreciated, especially on an HP41 with the Ir module. I see one site discusses building an Ir receiver linked to a parallel port error line using cheap Radio Shack parts, but I wonder if someone knows of a stock PC Ir receiver for either USB or serial that can take in data from an HP calculator Ir transmitter. Thanks.

      
Re: Ir ... I have an HP Ir question ...
Message #2 Posted by James M. Prange on 4 June 2003, 2:11 a.m.,
in response to message #1 by Randy

Ok, I see them, at http://www.martelinstruments.com/cased.html#MCP8800. I'd probably go for one of the models that includes RS-232 wired input, if I felt that I could spare the cash. Partly because the 49G, and I think at least one of the algebraic only models, lacks IR output but does have RS-232. The other thing is that the calculators always transmit IR at only 2400 bits per second, but by using wired connections, you can print at 9600 bps. Well, actually, I think that you can transmit by IR at higher speeds by using assembly languge code or perhaps SysRPL, but since the 82240A/B only receives at 2400bps and I can connect to the other calculators by wire, I've never tried that out.

If anyone tries one of these, please do report on your experience.

Yes, I've heard of using the IR to transmit/receive to/from a PC. I've never tried it myself, but the key is that your adapter needs to use plain "Serial IR" (SIR), not the more elaborate IrDA protocols. And making a receiver for the "Red Eye" IR format used for printing sounds quite complicated, and not worth the trouble.

I don't know about the other calculators, but on the 48G series, if you set the flags to print by wire (a mislabeled flag) and I/O by IR, then it prints by IR in the SIR encoding encoding rather than Red Eye encoding.

More information on the 82240A/B Red Eye encoding can be found at http://www.hpcalc.org/details.php?id=4742, and on the 48 series I/O (both wired and IR) at text: http://www.hpcalc.org/details.php?id=1722 or PDF: http://www.hpcalc.org/details.php?id=4741. These last two are for the 48 series of course, but I'd expect the other calculators to share a good deal with them.

Regards,
James

      
Re: Ir ... I have an HP Ir question ...
Message #3 Posted by Christoph Giesselink on 4 June 2003, 1:45 p.m.,
in response to message #1 by Randy

> But here's my question: Wouldn't it be nice to use the HP Ir calcultor output to send data directly to a PC? Has anyone done this?

The protocol information is available at http://www.hpcalc.org/details.php?id=4742.

> Is the little HP Ir to RS232 adapter by Aegis (IR-HP5) for about $40 the answer?

No it isn't, the IR-HP5 is a "normal" IR to wire converter for the normal RS232C protocol. Reason, the product is advertised with max. 57600 baud, the HP Red Eye printer protocol has a fixed baudrate somewhere around 600 baud.

> All this was probably covered by previous questions and answers here or in those old user groups (or is that groups of old users?), but I thought I would ask again because this forum is such a great brain trust. Any observations on HP Ir issues would be appreciated, especially on an HP41 with the Ir module. I see one site discusses building an Ir receiver linked to a parallel port error line using cheap Radio Shack parts, but I wonder if someone knows of a stock PC Ir receiver for either USB or serial that can take in data from an HP calculator Ir transmitter. Thanks.

I wrote a DOS program to decode the data for a dumb IR->Wire hardware interface, something like the Radio Shack one, in the early 90'ties. Therefore I used one of the modem status input lines of the serial interface. But this solution caused several problems:

  • Making timing is a big problem because of different speed of PC's
  • Only works in real DOS mode, because only here you have real time control to the hardware
  • Non standard (but very simple) IR receiver hardware
  • Don't worked on all PC's (unknown reason)

But who has nowadays real DOS machines? So my solution and IMHO the only realistic solution nowadays is an intelligent hardware converting the HP-Redeye protocol into another more useable (Serial RS232C, USB, ...) one. My solution for RC232C is very simple from the hardware aspect. A microcontroller, an integrated IR-receiver chip (Temic TSOP1833), inverting the TXD signal, and a very simple power logic. But the software is the expensive part and in my case I haven't the rights to publish them.

Regards

Christoph

            
Re: Ir ... I have an HP Ir question ...
Message #4 Posted by James M. Prange on 5 June 2003, 6:07 a.m.,
in response to message #3 by Christoph Giesselink

Quote:
> Is the little HP Ir to RS232 adapter by Aegis (IR-HP5) for about $40 the answer?

No it isn't, the IR-HP5 is a "normal" IR to wire converter for the normal RS232C protocol. Reason, the product is advertised with max. 57600 baud, the HP Red Eye printer protocol has a fixed baudrate somewhere around 600 baud.


I stand corrected. I was thinking that the HP Red Eye printer protocol was 2400 bps, but it's actually much lower, and when you consider that the Red Eye protocol includes 4 error correction bits with each byte, then it's effectively about the same as 600 bps RS-232.

I don't know which calculators Randy has in mind, but with the 48 series, you can indeed send and receive in "Serial IR" (SIR) protocol. This is always at 2400 bps. SIR is very similar to RS-232, except that an IR pulse (nominally 52 microseconds, about an eighth of a bit width) represents a 0 bit, and the absence of an IR pulse represents a 1 bit (or idle condition). I don't know for certain, but the IR-HP5 might be suitable for this.

Since IR I/O is half-duplex (because of the likelyhood of reflected signals), XON/XOFF serial flow control isn't available. But of course, if you use the built-in Kermit protocol, then you don't need XON/XOFF.

If you set flag -33 ("I/O directed to IR port"), and set flag -34 ("Printer output directed to serial port if flag -33 is clear"), then your printing will be in SIR protocol instead of Red Eye protocol. The "Fine Manual" leaves a bit to be desired here. Such things as print delay pacing, line termination string, and ASCII translation behave the same when print by SIR as when printing by wire.

See the documents mentioned earlier in the thread for more information.

Regards,
James

Edited: 5 June 2003, 6:14 a.m.

                  
Re: Ir ... I have an HP Ir question ...
Message #5 Posted by Christoph Giesselink on 5 June 2003, 2:25 p.m.,
in response to message #4 by James M. Prange

> I stand corrected. I was thinking that the HP Red Eye printer protocol was 2400 bps, but it's actually much lower, and when you consider that the Red Eye protocol includes 4 error correction bits with each byte, then it's effectively about the same as 600 bps RS-232.

This isn't correct, you can't compare the 416us (2400 baud) bit time of the Serial InfraRed protocol with the 427us _half_ bit time of the HP REDEYE HP82240B printer protocol. Both protocols use a complete different framing. The original question from Randy was asking for a receiver to capture the HP82240B printer protocol (HP REDEYE) data and not for a Serial InfraRed (SIR) reader.

The ~600 baud of HP REDEYE HP82240B printer protocol mentioned in my prior posting is calculated by

baud = 1 / ((pulse/freq) * d * hframes) * bitsperbyte

with

  • pulse = 7 = no. of IR pulses per half bit
  • freq = 32768 = frequency of IR pulses
  • d = 2 = pause after IR pulses
  • hframes = 30 = no. of half bit frames = 3 + 2*(4+8) + 3 = 3 sync pulses + 2 half bits * (4 error bit + 8 data bits) + 3 half bits pause after each packet
  • bitsperbyte = 8 = relevant data bits per byte to make it comparable, you can also use 10 here when you're thinking about 8 data bit + start and stop bit of the SIR protocol

the final baud rate is

baud = 1 / ((7/32768) * 2 * 30) * 8 = 624

Randy though about the HP17B, HP17BII, HP18C, HP19B, HP19BII, HP27S, HP28C, HP28S, HP41 with Ir printer module, HP42S calculators (hopefully I forgot none) which all only can send data in the HP REDEYE HP82240B printer and not the Serial InfraRed protocol.

But these 624 / 8 = 78 bytes/sec are only theoretically, the transmitter routine has to disable interrupts and has the calculate the 4 error correction bits and a little bit more at runtime so you have at least about 70 bytes/sec on these calculators.

> I don't know which calculators Randy has in mind, but with the 48 series, you can indeed send and receive in "Serial IR" (SIR) protocol. This is always at 2400 bps. SIR is very similar to RS-232, except that an IR pulse (nominally 52 microseconds, about an eighth of a bit width) represents a 0 bit, and the absence of an IR pulse represents a 1 bit (or idle condition). I don't know for certain, but the IR-HP5 might be suitable for this.

This is correct, but wasn't asked. Further information about connecting a HP48 over Serial InfraRed protocol to a PC can be found at http://www.hpcalc.org/details.php?id=4856.

Best Regards,

Christoph Giesselink, Homepage

                        
Re: Ir ... I have an HP Ir question ...
Message #6 Posted by James M. Prange on 5 June 2003, 8:48 p.m.,
in response to message #5 by Christoph Giesselink

Hi Christoph,

Quote:
This isn't correct, you can't compare the 416us (2400 baud) bit time of the Serial InfraRed protocol with the 427us _half_ bit time of the HP REDEYE HP82240B printer protocol. Both protocols use a complete different framing.

Apparently we basically agree on a lot of this, but perhaps I don't understand the definition of "baud". I think of "baud" as "bits per second" or "1/bit time". By "effectively about the same as 600 bps RS-232", I meant that either would send about the same number of bytes per second. The comparison was intended to be a very rough one.

For the RedEye encoding used for the 82240A/B: "A bit time is defined as precisely 28 cycles of an exact 32768 Hz reference, about 854.5 microseconds." Thus, slightly over 1170 bits per second. A 1-byte frame consists of a "start bit", which is 3 half-bits, plus 4 error correction bits, plus 8 data bits, for 27 half-bit times. A delay of at least 3 half-bit times is needed before the next frame begins. Thus, there are at least 30 half-bit times, or 15 bit-times, per 1-byte frame. So 15*28=420 cycles of a 32768 Hz reference, or about 12.8 ms, is needed to transmit one byte. Looking at it another way, 32768/420 yields slightly over 78 bytes per second. Of course, the operating system will no doubt add delays because it has a lot of work to do, but perhaps 78 bytes per seconds might be achieved within bursts. Surely we can expect each individual byte to be transmitted in about 1/78 second.

For 2400 bps RS-232, a bit-time is of course 1/2400 second, or about 417 microseconds. A 1-byte frame (sending from an HP 48 series) is 1 start bit, plus 8 data bits (or 7 data bits plus 1 parity or pseudo-parity bit), plus 2 stop bits, and a 3/16 (0.1875) bit-time delay is added before the next frame can begin. Thus, 11.1875 bit-times (about 4.66 ms) are needed for each byte. Looking at it another way, 2400/11.1875 yields slightly over 214 bytes per second. Of course, when using a file transfer protocol, numerous delays are involved, so you can't expect to achieve an average of 214 bytes per second as the transfer rate. But when using XMIT, without transmit pacing, I've experimentally found that a 48 really does transmit at about the theoretical maximum rate.

Of course the 48 doesn't allow for 600 bits per second. But if it did, then the maximum rate would be about 54 characters per second.

Quote:
Randy though about the HP17B, HP17BII, HP18C, HP19B, HP19BII, HP27S, HP28C, HP28S, HP41 with Ir printer module, HP42S calculators (hopefully I forgot none) which all only can send data in the HP REDEYE HP82240B printer and not the Serial InfraRed protocol.

Sorry, I didn't read Randy's mind, but just what he'd actually written in his post. What came to my mind was the 48 series, where data and file transfers are routine, and I've read that someone has very successfully used a relatively simple SIR to RS-232 adapter, without any need to connect a cable to the calculator.

Even if what I've written doesn't help Randy, perhaps it will help others. Not having to connect a cable might be sufficient compensation for having to use 2400 bps instead of 9600 bps, particularly for short transfers. Apparently, HP felt that this was the case for transfers between two 48 series calculators.

Of course a RedEye to RS-232 adapter could be built, but it would be considerably more complicated than an SIR to RS-232 adapter.

Best Regards,
James

      
James & Christoph, Thanks!
Message #7 Posted by Randy on 9 June 2003, 4:06 p.m.,
in response to message #1 by Randy

James & Christoph: Thanks for taking the time to share some of your knowledge base. Your insights have been very helpful. A redeye to serial adapter would be perfect because what I use now is HPIL to serial to send ASCII strings to be captured by a PC. I add coma delimeters in the RPN program which I then import into Excel, then into AutoCad because part of the ASCII string generation calculates geographic coordinates. I don't mind having the wire, but it would be nicer without. The HP 41 acts as a paperweight as I move it around on large maps to analyze and collect the data. It's like a very smart mouse I guess. A very smart wireless mouse would be nice. I'm hooked on pure RPN and the just-right feel of the HP classic case, so I remain a couple decades behind in parts of my technology, but the system is productive. I don't think I'll go much further with redeye thinking because the range is so limited. At one website it was said that HP deliberately kept the redeye range low so students wouldn't send cheat sheets back and forth during exams -- an interesting theory. It's fun to visit this site to learn more, and thanks again! - Randy

            
Re: James & Christoph, Thanks!
Message #8 Posted by Christoph Giesselink on 10 June 2003, 12:25 p.m.,
in response to message #7 by Randy

> I don't think I'll go much further with redeye thinking because the range is so limited. At one website it was said that HP deliberately kept the redeye range low so students wouldn't send cheat sheets back and forth during exams -- an interesting theory.

Only one minor comment. The website is right, when you compare the possible IR distance between HP products.

The possible distance over IR are normally between

  • HP48<->HP48 are some centimeter
  • HP48->HP82240B < 0.5m
  • HP42->HP82240B < 0.5m

The reason of this limitation is the IR receiver hardware. My REDEYE receiver using the receiver IC Temic TSOP1833 without any cover (placed behind a hole in the case). I made some distance tests with this reiceiver and my HP48SX and I got possible transmitting distances between some millimeter up to 8 meter indoors (the room wasn't bigger, so the possible receiving distance maybe greater)! So the distance is no limitation IMHO.

Hope one of your HP's is working to transfer the European length units into your favorite ones. :)

Regards

Christoph


[ Return to Index | Top of Index ]

Go back to the main exhibit hall