HP-42S with HP-82240B Printer


I'm using my HP-42S in combination with the HP-82240B printer for several years now. But there's one big problem about graphics which I never managed to solve and that's why I'm seeking help from you.

Since the calculator's alpha register handles only 44 signs at the same time, any graphic sequence larger than 42 pixels (44 minus the two signs for the escape sequence) has to be splitted into two, three or four parts. So to print for example a 50 pixel wide graphic sequence, I have to enter the following: CLA, 27 XTOA, 50 XTOA followed by 42 times let's say 195 XTOA. To transmit the (still uncomplete) data to the printer I use the PRA-command. At this point the printer doesn't print anything, because he correctly awaits 50 signs, and writes the sequence into the buffer. No problem so far! But when I try to send the remaining 8 signs (CLA, 8 times 195 XTOA, PRA), the printer draws the following sequence:


before continuing with the correct graphic. In decimal code this means: 4, 4, 27, 252. So it seems that either the printer or the calculator (by means of the PRA-command) adds AUTOMATICALLY two right-stop line-feeds and one "return to normal width"-command. How can I prevent them from doing this?

P.S. To avoid this problem I always used the PRLCD command, but since the display of the HP-42S has only 131 pixels, I could never take advantage of the 35 supplementary pixels of the printer.


Edited: 31 Oct 2005, 1:53 p.m.


Hello Joe:
[This may not be an answer, but hopefully it helps.]

In the HP42s Manual, there is a printer plotting program which does not (cannot?) use the full width of the printer paper. I don't believe the HP42s can send hex codes to the printer (as the HP48 does), so you are limited to the width of the LCD display.

Good Luck,


Thanks for your answer, Tom!

You're right! I know this program very well. I've even written my own version of it, so that it draws an y-axis too now (I simply couldn't understand why they had forgotten this). But it is obvious that this program CAN'T use the entire paper width because it doesn't directly address the printer. Nor does the enhanced version from the Advanced Programer's Manual (with up to 3 simultaneous functions).

My question however refers only to DIRECT printer adressing. This is undocumented in both HP-42S manuals, but you CAN use the escape sequences via 27 XTOA. So you can change v.g. the character set from ROMAN 8 to ECMA 94 which allows the use of greek letters.

By the way, why does the character code table at the end of the User's Manual show both decimal and hexadecimal codes for each character? Only by convention?


I'm not familiar with the 42S, but to find out what the printer does with whatever it receives, you might find the HP82240B Technical Interfacing Guide PDF useful.



By the way, why does the character code table at the end of the User's Manual show both decimal and hexadecimal codes for each character?

Well, sometimes it's easiest to use the decimal notation, and sometimes it's easiest to use the hexadecimal notation.
Only by convention?

Actually, I suspect that showing both notations is somewhat unconventional. I wish more character tables would do this; it would sometimes save me the trouble of converting.


Edited: 1 Nov 2005, 1:05 a.m.


Thanks for this hint! Very interesting paper!
But it doesn't help in this situation, because I don't know what the PRA command does actually sent to the printer.



It's possible to find out what the 42S sends to the printer by using a 48 to capture its output. There is a prgram called INPRT that does this; I've used it myself to work out some details in the Free42 printer emulation.

In case you don't have a 48 yourself, I'd be happy to run some tests for you and send you the results.


An excellent suggestion! But note that the version of INPRT published by HP remaps many non-ASCII characters from their Roman 8 character set to their modified ECMA 94 character set, which can muddy the issue. However, there are versions available which either skip the remapping or "remap" all non-ASCII characters to themselves; look for one of these versions.



Instead of the INPRT version you can use the BINPRT program from the Clamshell/Pioneer ROM Upload package at http://privat.swol.de/ChristophGiesselink/Emu28/CPROMUPL.ZIP. This is a recompiled INPRT version without any conversation.

And here we have another possibility, using the PC version of Emu42 with the integrated debugger.

The IR transmitter routine is at

OUTBYT EQU #0318D (HP42S rev. A)
OUTBYT EQU #031D6 (HP42S rev. B/C)

and the character to transmit is located in A[B]. So it's easy to set a breakpoint in the debugger and watch the A[B] register.

I made a small test with "ABC" in the alpha register and I got (in HEX) with PRA


translated this means

1B,FC = print with normal character width

41,42,43 = ABC

04 = special line feed

This explain the entire behavior I think.



Edited: 2 Nov 2005, 12:46 p.m.


Vielen Dank!

Genau das hatte ich mir auch gedacht! Da ich leider keinen HP-48 besitze und daher auch den Emulator nicht installieren kann, möchte ich nachfragen, ob Du nicht für mich noch einige wenige Tests durchführen könntest.

Beste Grüße,


Possibly Related Threads...
Thread Author Replies Views Last Post
  Use 82240B as computer printer R. Pienne 3 749 12-09-2013, 12:19 PM
Last Post: Marcus von Cube, Germany
  HP-97 Printer Malfunction Dan Lewis 17 1,627 11-25-2013, 10:18 AM
Last Post: Thomas Chrapkiewicz
  HP-97 Printer Troubleshooting aj04062 6 858 10-15-2013, 08:45 PM
Last Post: Eric Smith
  Joys of eBay: HP-32S, HP-32SII, HP-42S, HP-16C, ... Sasu Mattila 7 761 09-23-2013, 04:39 PM
Last Post: Julián Miranda (Spain)
  HP-97 Printer Head aj04062 1 393 09-11-2013, 09:18 PM
Last Post: Randy
  HP-97 Printer Head aj04062 0 286 09-10-2013, 09:19 PM
Last Post: aj04062
  Mastermind for HP-42s Tom Grydeland 12 1,142 09-02-2013, 03:43 PM
Last Post: Kimberly Thompson
  HP-97 Printer parts davorin 5 718 08-29-2013, 02:10 AM
Last Post: Benoit Maag
  HP-42S Turbo Juergen Keller 10 937 11-17-2012, 05:48 PM
Last Post: Paul Dale
  HP-46 printer Ignacio Sánchez 10 789 11-14-2012, 03:25 AM
Last Post: Ignacio Sánchez

Forum Jump: