\section{Basic operation of the HP9866A}

Since the operation of the HP9866A is not as well-known as that of the 
HP9800 machines themselves, this section will give an overview of the 
printer operation.

The design of the printer's control electronics was dictated by the 
design of the mechanism, and more particularly the printhead. This is 
fixed to the printer chassis, it does not move across the paper, and 
consists of 400 tiny heating elements in a horizontal row across the 
paper. These elements are not evenly spaced, rather they are in 80 groups 
of 5, forming the 5 dot columns of the 80 characters that this printer 
prints on each line. When the heating element is energized, it causes the 
(specially-coated) paper to darken. 

Therefore, at the most basic level, the operation of the printer is as 
follows : 
\begin{enumerate}
\item Read in characters from the host and store them in an internal line 
buffer memory until an end-of-line character is received
\item Read out the buffer store, one character at a time, convert it to the 
appropriate bit pattern for the next dot line of that character and send 
it to the print head, where it will be stored, but do not energise the print
elements yet
\item When all 80 characters have been processed, turn on the selected 
elements for a given time
\item Advance the paper one dot line.
\item If not all 7 lines have been printed, go back to step 2 to print 
the next line of dots.
\item When all 7 lines have been printed, advance the paper to give the 
inter-line gap
\end{enumerate}

Unfortunately, in practice, it's a little more complicated. To save storage 
in the printhead circuit, and more importantly to reduce the maximum 
current that might be drawn from the power supply, only a quarter of the 
printhead elements are energised at a time. On the first `pass' through 
the buffer store, characters 0,4,8,12,\ldots are printed. On the next 
pass 1,5,9,13,\ldots and so on. 

Also if fewer than 80 characters are send by the host before the 
end-of-line character, the remainder of the buffer will presumably 
contain random data. Therefore it is necessary to fill the remainder of 
the buffer with space characters when the end-of-line character is 
received before attempting to print the line.

Therefore a more complete description of the printer operation is :
\begin{enumerate}
\item Read in characters and store them in the buffer until an 
end-of-line character is received
\item When the end-of-line character is received, fill the remainder of 
the buffer with spaces
\item Read out every fourth character of the buffer and convert it to the 
correct bit pattern for the next line of the character, then end that to 
the printhead 
\item When 20 characters have been processed in this way, energise the 
printhead elements for the standard time
\item If all 80 characters have not been processed, then select the next 
quarter of the buffer and go back to step 3
\item When the entire dot line has been printed, advance the paper one 
dot line and go back to step 3 to print the next dot lien of the characters
\item When all 7 dot lines have been printed, advance the paper for the 
inter-line gap
\end{enumerate}

\section{Implementation and layout}

Before considering the theory of operation of the various sections of 
the printer it is helpful to have a basic idea of the design and layout. 
As with many computer-related devices, the electronics can be split into 
2 main sections, namely the {\bf data path} and the {\bf control}.

The {\bf data path }contains the buffer memory register which is 
implemented 
using 80-bit shift registers. It also includes the character generator 
ROM and the printhead storage register, again built from shift registers. 

The {\bf control} section is based round a 32-state finite-state machine. 
Associated with this are are several binary counters which keep track of 
the number of characters in the buffer store and the number of dot-lines  
printed. 

Physically the electronics consists of 7 PCBs. The 2 main logic boards 
contain the {\bf data path} and {\bf control} sections. These are 
plugged into the {\bf logic backplane} PCB along with a further PCB, the 
{\bf Logic PSU}. Plugged into the side of this backplane is the {\bf 
Printhead Driver} PCB which contains the printhead storage shift 
registers. 2 Further PCBs, the {\bf Printhead PSU}, which provides the 
high voltage needed for the printhead elements, and the {\bf Motor 
Driver} are plugged into connectors mounted on the main chassis. Also 
separately mounted are some of the larger power supply components such as 
the mains transformer.

Mechanically the printer mechanism is very simple. Since the  printhead 
covers the full width of the line and does not move, the only motion is 
that of the paper. The platen roller is directly coupled to the stepper 
motor spindle, a pressure roller held against the platen is coupled to 
the paper loading roller by a toothed belt. 

