The following information is provided as is, and the authors take no responsibility for the correctness.
The Printing Performance Architecture (PPA) is a closed, proprietary protocol developed by Hewlett Packard for a short-lived series of DeskJet printers.
In essence, the PPA protocol moves the low-level processing of the data to the host computer rather than the printer. This allows for a low-cost (to produce) printer with a small amount of memory and computing power. However, in practice the printer was often as expensive as more capable printers.
HP has since discontinued the use of PPA in favour of returning to PCL3e in their latest USB-based printers.
The PPA protocol is actually composed of two protocols:
This reference manual is based on information gathered by Tim Norman and articles from the “Hewlett-Packard Journal”
This information may not be accurate. It has been compiled from experimentation and other means that may be prone to error.
The PPA protocol is actually composed of two protocols: a lower-level packet protocol called VLink and the Sleek Control Protocol (SCP). The VLink protocol regulates all data transferred back and forth between the printer and the computer. SCP sends command sequences to tell the printer to do things like load a sheet of paper, eject, and print a sweep.
Although PPA is a bi-directional protocol, I have mainly concentrated on its uni-directional component. It is not required for the host to be aware of the bi-directional nature of the device, which makes this easy to do.
All values are stored in big endian format.
The link layer provides a simple logical channel protocol. To prevent the printer’s input buffer from completely filling up and preventing communication with the PC, image data and command data are separated into two logical channels. Each of these two logical channels is individually paced to prevent one from blocking the other. To separate the data and commands into two logical channels, the raw bytes are packetized so that a channel number can be assigned to each packet.
To packetize the data, VLink adds four additional header bytes to each block of data. First, a start-of-packet character, $, is sent. Second, one byte specifying the channel number is sent. Third, a word is sent indicating the number of data bytes to follow. A packet can contain up to 64K bytes of data. Custom I/O hardware strips off the four header bytes, uses the channel number to select a ring buffer in RAM in which to store the data, and subsequently transfers the data into the ring buffer by DMA.
|1 byte||Start of Packet character '$'|
|1 byte|| Channel
0x00: Image Data
0x01: Commands and responses
0x02: Auto status
0x80: Periodic Ring Buffer Pacing
|2 bytes||Length of packet|
|n bytes||Packet data|
A packet can contain up to 64K bytes of data.
Incoming packets arrive for either channel 0 or channel 1. Channel 0 is used for image data. Channel 1 is used for commands. Outgoing packets are transmitted using channels 1, 2, and 128. Outgoing channel 1 is used for responses to commands. Outgoing channel 2 is used for the periodic autostatus information. Outgoing channel 128 is used to supply pacing information to the host PC.
For output, the main control I/O process receives SEND messages from the other processes within the system. Like input, output is formatted as VLink packets. Three VLink channels are used: channel 1 to transmit command responses back to the host, channel 2 to transmit periodic autostatus back to the host, and channel 128 to transmit I/O buffer pacing information back to the host.
The design handles cases when bidirectional I/O is not available. This can happen when the printer driver is busy and not communicating with the parallel port, when the driver is not running at all, when an external device using non-IEEE-1284-compliant cables is between the printer and the host, when the PC does not support IEEE 1284, or when there existmiscellaneous hardware and software conflicts with the parallel port.
In cases where bidirectional I/O is not available, output is prevented from accumulating inside the printer by buffering at most one packet per VLink channel. Any previous packets are automatically recovered back into the system and never transmitted. This priority scheme ensures that the host PC always receives the latest status. The only repercussion for bidirectional systems is that the driver cannot send multiple queries to the printer without waiting for each individual response.
A key and early concept of PPA is that data arriving at the printer will already be formatted for the custom ASIC hardware controlling the print cartridges. In other words, the firmware and microprocessor in the printer do not process the data, nor do they move the data in RAM. The image data is transferred by DMA into the image ring buffer from the ASIC I/O block and from the ring buffer to the print control ASIC blocks.
When image data is sent over the image data channel, it takes a form that is very close to how it is presented to the print head mechanism. The code in ppa.c (Appendix A) best describes how this data is organized. The PPA sweep data will also be attempted to explain.
The image data may also be optionally compressed. I have not yet worked out the details of the compression method, though it seems similar to the compression used for the PCL protocol. My code currently generates uncompressed data only.
Printing on HP820 with pnmn2ppa-1.0 fails with flashing light syndrome if the vertical position of two successive sweeps differs by 1, 2, or 3 dots. (This was observed for the case when one sweep is black, the other is color). If the two sweeps have the same vertical position (as in Windows 9x printing, its OK)
To keep the host PC informed of the status of the printer, an autostatus process periodically formats a data block with the printer’s current status. This data block is then given to the I/O module for transmission back to the host on VLink channel 2.
When one of the input ring buffers fills up completely and another byte arrives for this full ring buffer, the overflowing byte causes the parallel port’s BUSY line to raise and hold off the host PC from transmitting any further data. Such a situation could prevent the host PC from querying the printer’s status or canceling a print job, so the printer and host work together to prevent either of the input ring buffers from completely filling up, thus allowing the other ring buffer to continue to receive data.
The printer transmits back to the host periodic ring buffer status information on VLink channel 128. The data transmitted indicates both the instantaneous free space available in each buffer and the amount of data recovered from the ring buffers. The amount of data recovered from the ring buffers is cumulative. In other words, the printer reports the total number of bytes it has recovered from all of the input buffers.
This total number of recovered bytes permits the host PC to determine exactly how much space is available at any time in the printer’s input buffers, as long as it keeps track of how many bytes it has itself transmitted. This mechanism is required because the printer’s report of the free space available in the input buffer is only an instantaneous reading. It doesn’t account for any data in transition and could thus give the host PC a false reading.
SCP provides the command protocol for communication between a PPA printer and its host driver. SCP is a binary language (as opposed to the ASCII formatting of the traditional PCL command language). It appears that SCP differs depending on the series of printer that is being used.
Used by HP DeskJet 820Cse
|ID||2 bytes||Identifies the command|
|Reference||2 bytes||Reference number used to cancel commands|
|Priority||1 byte||Order in which the command is processed|
|Pad||1 byte||Padding byte|
|Length||2 bytes||Number of additional data bytes|
|Data||0..n bytes||Depending on command, typically contains a number of sub fields|
|0x12||PRINT_SWEEP||Configure hardware to print a sweep of data|
|0x13||HANDLE_MEDIA||Load and eject|
|?||HANDLE_PRINT_CARTRIDGE||Print cartridge change, wipe, spit, etc.|
|?||CONFIGURE_PRINT_CARTRIDGE||Print cartridge temperatures|
|?||STATUS_REQUEST/REPORT||Synchronous status information|
|?||CONFIGURE_AUTOSTATUS||Asynchronous status information|
|?||CANCEL_COMMAND/DATA||Flush a command or image data|
|?||UI_STATE||User interface set|
|?||UI_MONITOR||User interface read|
|?||ATOMIC_COMMAND||Low-level manufacturing and test command|
Used by HP DeskJet 720 series