Peter Dawson
It is published by IBM and can often be found bundled with packages like Microsoft's Windows Software Development Kit.
It comes in two volumes with the IBM part numbers SC26-4583-0 (Basic Interface Design Guide) and SC26-4582-0 (Advanced Interface Design Guide). The advanced guide was updated last year.
Peter Jacobs and James Wilde
Jeffrey Graham
The Centronics interface takes its name from the printer manufacturer who first started using it. It is not an official standard, for this reason, and there are a number of different flavors out there. The differences normally relate to the combination of signals implemented (many makers choose a subset) and the maximum loading and timing values for the signals themselves. In practice, most makers implement a common core of the useful pins and allow enough slack for the timings and loadings to make the system reliable.
The table shows the pins as they are implemented on the 36 Way Amphenol connector found on the back of standard Centronics printers. IBM decided to be different and used a 25 way miniature D-connector for their parallel port (up until then this was the standard for serial ports instead) but most of the important pins still appear in the same order.
All signals are at TTL level (0-1V means off and +4-5V represents on). Buffering tends to allow up to 6m of cable between units, though the normal recommendation is 1-2m. Originally the signal wires should have been twisted pairs with individual returns, though this is seldom the case with cheap modern cables.
Data can be passed using one of two possible methods of synchronisation - BUSY or ACKNLG. BUSY is the easiest to implement; basically you wait for BUSY to go low (if necessary), assemble the data on pins 2-9, wait 0.5uS for it to stabilise, pull STROBE low for 0.5uS, wait another 0.5uS and then start again.
Using ACKNLG you ignore BUSY but can expect a 12uS low pulse from the printer after it has digested your byte. Once you have received this you can assemble and STROBE the next byte, but you must also check ERROR or risk your data ending up in the bit bucket. This is not necessary if you are using BUSY for synchronisation as this will remain high if any form of printer error exists.
The choice of synchronisation method is left to the computer. If you use BUSY you can safely ignore ACKNLG and vice-versa.
PE (if implemented) will come on simultaneously with ERROR and BUSY so you only need to read it if you wish to differentiate between this and other errors. If the printer is off-line this is also considered an error condition.
Note that the pulse times given are to appear at the printer's end of the cable, not on the computer's interface. You can normally get away with a 0.2uS rise time on all the signals.
The best source of information specific to the IBM PC's parallel port for the low level programmers point of view is probably the Technical Reference Manual published by IBM.
Frank Leonhardt
| Pin | Name | Description |
| 1 | STROBE | 0.5uS pulse low when data is valid, otherwise high. |
| 2-9 | Data 0-7 | The data pins, active high. |
| 10 | ACKNLG* | Pulsed low by the printer for 12uS after data is read. |
| 11 | BUSY* | High when printer is unable to accept data. |
| 12 | PE* | High when paper is empty. |
| 13 | +5V* | Useful voltage |
| 14 | AUTO FEED | When low, automatically Line Feed after Carriage Return. |
| 15 | NC | |
| 16 | 0V | Logic ground |
| 17 | Case GND | The earth, used for screening. |
| 18 | NC | - |
| 19-30 | GND | Return for pins 2-9 |
| 31 | RESET | 50uS low to reset printer. |
| 32 | ERROR* | Low means the printer needs attention. |
| 33 | GND | - |
| 34 | NC 35 | +5V* - |
| 36 | SLCT IN | Device select codes are only valid when this is high. |
Peter Jacobs None really. It is one of the few examples, like Macs for DTP, where the application should govern the hardware used.
You could look at AutoDesk animator, or Director on the Mac but neither approach the VFM the Amiga offers for desktop video.
Simon Rockman
@IF(A1&gr=0,A1,@REPEAT(" ",@CELL("WIDTH",B1)-(@LENGTH(@MID(@STRING(A1,2),1,10))+5))&"("&@MID(@STRING(A1*100,2),1,10)&"%)")
This formula assumes that you have the numbers you want to display as percentages in column A and the formulae to show the percentages in column B. The following example illustrates the results:
| A | B |
| .5 | 50.00% |
| .25 | 25.00% |
| -.5 | (50.00%) |
| -.25 | (25.00%) |
This technique works with Lotus 2.x, 3.x and Lotus 1-2-3 for Windows, as well as Quattro. Excel users need only define a number format as follows:
Choose Format, Number and move to the Format Box. Here replace the displayed format with 0.00%;(0.00%) to accomplish the result shown above.
Shane Devenshire, Walnut Creek, California.
This equipment word is located in low memory and is set every time the machine is booted. It includes bits indicating the number of printers installed, the initial video mode and a bit to indicate whether a games adaptor is installed. On my machine, and others I have tried, the games bit was not set even though a games card and joystick are installed.
As the equipment word is in RAM it is a simple matter to fix, even if you don't have an assembler or computer. Just type in the following commands via debug and a program can be produced that can be called from AUTOEXEC.BAT. The program is tiny (only 17 bytes long) and is not even a TSR so there is no loss of precious RAM.
Proceed as follows:
Run DEBUG from the DOS prompt and enter the following. Note that the '-' is DEBUG's prompt and you should not type it again yourself.
-D 0040:0010 L 2
Debug will respond with four numbers in the format:
0040:0010 ## ##
^
Look at the third hex digit; if it is even then the equipment word is saying
that no games adaptor is fitted. (Even hex digits are 0, 2, 4, 6, 8, A,
C and E).
If your number is odd then type QUIT as this is not your problem (see below). If is even then continue as follows:
-A 100
This starts assembling a program at the correct starting address for a .COM
file. The prompt will change to the format below, where the '#' characters
vary from system to system.
####:0100 Enter the code shown in Listing 1. Again, the prompt has been shown and should not be typed. Also, the comments listed against each line should be omitted.
-R IP
IP ####
:
If the number printed (####) is not 0100 then enter 0100 and press return; otherwise just press return. To test the program enter 'G' at the minus prompt. You should get a message to indicate that it terminated normally and you can check to see that it worked by entering 'D 0040:0010 L 2' as described above. The third digit should now be odd; if it is not then retype the program and try again. Assuming all is well then set the BX register to zero and the CX register to the length of the program in the same way the IP register was set above:
-R BX
BX ####
:0000
-R CX
CX ####
:0011
Then we give the program a name (I have chosen JOY.COM) and write it out
to disk with:
-N JOY.COM
-W
Writing 00011 bytes
-
The program has now been saved in the current directory and debug should be quit by typing QUIT at the '-' prompt. Simply issue the command JOY before playing your troublesome game or included in your AUTOEXEC.BAT file.
If the suggestion above fails to solve your problem there is another cause which, although rarer, is more difficult to fix. The joystick requires an interrupt 15h service 84h routine which is simply not present on early versions of the ROM BIOS. If this appears to be your problem then it may be possible to write a TSR handler to emulate it, though this is outside the scope of this article!
J D Coup,
Reading.
Computer Answers Archive Next edition Previous edition