Mike's PCjr Page Logo

IBM PC Compact Printer

Overview

The IBM PC Compact Printer (model 5181) was a low cost thermal printer designed specifically for the PCjr. The original price of $175 was very inexpensive compared to other printers, but the PC Compact Printer was also a very low-end printer when compared to the more expensive printers. An adapter dongle was available to allow it to be used with a standard RS232 port.

I suspect that IBM did not sell too many and they wound up in the hands of resellers who found creative uses for them. You will sometimes find these printers adapted for other computers such as the Commodore 64.

Here are the important features:

  • Serial interface running at 1200 bits per second
  • Eight wire thermal print head requiring thermal printer paper
  • Speed: 50 characters per second
  • Paper feed: friction
  • Character set: 96 ASCII printable characters with some international characters
  • Characters per line: 80 (standard), 136 (compressed), 40 (double-width) and 68 (compressed double-width)
  • Character box: 7 cols x 8 rows. (Cols 1 & 7 left empty for alphanumeric chars, row 8 is used for descenders.)
  • Unidirectional (left-to-right) printing only
  • Graphics mode: One bit-image mode capable of laying down 560 dots horizontally at 70 dots per inch vertical and horizontal.

Further details including the serial wiring diagram can be found in the Options and Adapters supplement for the printer at http://www.minuszerodegrees.net/oa/OA%20-%20IBM%20PC%20Compact%20Printer.pdf.

The printer is controlled by a Hitachi HD6801V5P microcontroller that has up to 4K of ROM and 128 bytes of RAM in the package. A 2KB SRAM (HM6116P-3) can be found on the circuit board. The printer is only wired to receive data. Flow control uses the "Clear To Send" signal to pause the host computer.

The printer was very small for a printer - 3.5 inches tall, 12.3 inches wide and 8.7 inches deep. The thermal paper (sold in rolls) fit within the printer. The paper had to be torn or cut by hand as it did not come with perforation marks.

The printer DPI is unusual in that most Epson compatible printers were 72 DPI vertically and 60, 120, or some multiple of 60 DPI horizontally. The Epson "single density" bitmap mode is supposed to lay down 480 dots across 8 inches, which works out to 60 DPI.  This printer lays down 560 dots across in the single density mode, putting it at 70 DPI. That gives it a roughly 1:1 aspect ratio, which is unusal for a dot matrix printer.

Print samples

Below is a sample of the print from this printer:


You can see the side effects of a friction feed paper handling system in the first two lines. The eight wire print head generated print that was comparable to nine pin printers. (That isn't saying very much ... you can see it is not acceptable by modern standards.)

The graphics mode is very similar to the Epson graphics modes. Below is a sample of output from the Compact Printer:


(Historical note: This is a RLE graphic from Compuserve, back in the days before GIF images)

Here is a close-up of the small tree to the left of the pagoda at higher resolution:

IBM PC Compact Printer output closeup

(Click to see the full 600 DPI image)

Even in the more dense areas you can see plenty of paper showing through. Other dot matrix printers improved their print quality by making a second pass on each line, with the second pass slightly offset from the first pass. That might be possible on this printer but I'm not sure how well the fax paper would handle the process.

Below is a slightly more complex image - the "Colorpaint" machine from the home page of the web site side-by-side with a dithered version.




The dithered version was rotated to landscape mode because the image is wider than it is tall, and that allows a larger image to be printed. (The printer is constrained by the maximum horizontal pixel count, which is 560.) It is then converted to grayscale, dithered using the Floyd Steinberg algorithm, rendered for the printer using the printer escape codes, copied to a PCjr, and then sent to the printer. While the image can be recognized, it is not pretty to look at. Images with higher contrast generally work better:

Dash 8-400 printed on an IBM Compact Printer

(Alaska Airlines Dash 8-400 series printed on an IBM PC Compact printer.)

Self test and Test pattern program

Self test

The printer has a self test routine that can be run without a connection to a computer. To start the self test, hold the paper feed button while turning the printer on. The printer will continously print full lines of alphanumeric and graphics characters in this mode. To stop the self test turn the printer off.

Test pattern program

The PCjr technical reference manual covers the printer but some of the details are completely wrong. For example, it says the printer has no graphics capability yet it also documents the ESC K 480 bit-image escape code, which is supposed to allow you print up to 480 pixels across the page at 82 DPI. Clearly the printer has graphics capabilities, and the correct pixel count is 560 at 70 DPI. (The documentation that I linked above has the correct details.)

Before I found the correct documentation I wrote test programs to exercise the printer. The following test pattern consists of a row of graphics where:

  1. The first row has four pixels not printed followed by four printed pixels, alternating across the page.
  2. The second row has four pixels printed followed by four pixels not printed, alternating across the page.
  3. The third row prints every pixel.
IBM PC Compact Printer test pattern

The BASIC program that generated this is below:

100 REM Test pattern generator for the IBM 5181 PC Compact Printer
110 REM mbbrutman@gmail.com, 2021-02-14
120 REM
130 REM BASIC adds a CTRL-Z to mark the end of file when the file is closed.
140 REM This is silly and it needs to be removed. (I'm using a hex editor
150 REM to do it until I can remember the trick to make BASIC stop doing it.)
160 REM
170 REM Note that any pixel data that does not fit on the line is ignored.
180 REM I am taking advantage of this to see how much the printer can fit
190 REM on a line.
200 REM
210 OPEN "5181.prn" FOR OUTPUT AS #1
220 REM
230 REM Print a row 8 pixels high, alternating 4 pixels off and 4 pixels on.
240 PRINT #1,CHR$(24);CHR$(27);"0";:REM Reset the printer and set line spacing.
250 FOR B = 1 TO 75
260 PRINT #1,CHR$(27);"K";CHR$(8);CHR$(0);
270 FOR A = 1 TO 4:PRINT #1,CHR$(0);:NEXT A
280 FOR A = 1 TO 4:PRINT #1,CHR$(255);:NEXT A
290 NEXT B
300 PRINT #1,CHR$(13);CHR$(10);:REM Flush the printer buffer.
310 REM
320 REM Print a row 8 pixels high, alternating 4 pixels on and 4 pixels off.
330 PRINT #1,CHR$(24);CHR$(27);"0";:REM Reset the printer and set line spacing.
340 FOR B = 1 TO 75
350 PRINT #1,CHR$(27);"K";CHR$(8);CHR$(0);
360 FOR A = 1 TO 4:PRINT #1,CHR$(255);:NEXT A
370 FOR A = 1 TO 4:PRINT #1,CHR$(0);:NEXT A
380 NEXT B
390 PRINT #1,CHR$(13);CHR$(10);:REM Flush the printer buffer.
400 REM
410 REM Print a full row of pixels 8 pixels high.
420 PRINT #1,CHR$(24);CHR$(27);"0";:REM Reset the printer and set line spacing.
430 FOR B = 1 TO 5
440 PRINT #1,CHR$(27);"K";CHR$(128);CHR$(0);
450 FOR A = 1 TO 128:PRINT #1,CHR$(255);:NEXT A
460 NEXT B
470 PRINT #1,CHR$(13);CHR$(10);:REM Flush the printer buffer.
480 PRINT #1,CHR$(24);:REM Reset the printer.
490 CLOSE #1

The test program generates a file. While it is tempting to consider using LPRINT directly to the printer, I found that BASIC adds extra bytes to the output stream. It is probably possible to suppress those using the WIDTH statement, but I didn't bother to experiment.

BASIC still adds one last insult and appends an end-of-file marker (Ctrl-Z, ASCII code 26) to what is effectively a binary file. I removed the EOF marker using a text editor. You can download the test pattern file here.

To print the contents of the file from DOS do the following:

  • Set your COM port to use 1200bps, no parity, 8 data bits, 1 stop bit: "MODE COM2:1200,N,8,1,R" .  (The "R" is used to tell DOS to retry if the printer is busy.)
  • Copy the file to the COM port: "COPY /B PRINTER.PRN COM2:"

Note the /B is required when sending anything other than pure ASCII data to the printer. Otherwise DOS will interpret the first CTRL-Z character that it finds as the end-of-file marker and stop the transfer to the printer in mid-stream.

Printer BlinkenLights!

And finally, if you had made it this far you might enjoy a video of the printer in action: (Be sure to go full screen and select high definition video so you can see the RS232 signalling in action on the breakout box lights.)


IBM PC Compact Printer video snapshot

Not a bad little printer overall. You had no chance of printing letter quality with it, but for a quick listing or todo list it was more than adequate.

Created in July 5th 2009, Last updated July 17th, 2021
(C)opyright Michael B. Brutman, mbbrutman at gmail.com

Return to Mike's IBM PCjr Page main page