All HP9800 calculators have a hard copy facility. The HP9810 and HP9820 
have an optional internal thermal printer. The HP9830 has a built-in 
interface for an HP9866 printer which may be stacked on top of the 
machine. The HP9866 itself is outside our scope, but the internal printer 
and the interface will be described.

\section{HP9810/HP9820 thermal printer}
The internal printer of this machines consists of a mechanical system to 
feed the thermal paper past the printhead elements and 2 PCBs of 
electronics. The {\bf Printer Interface} PCB is mounted on the right hand 
side of the mechanism. The {\bf Printer Driver} PCB is located under the 
mechanism and is plugged into an edge connector on the {\bf Printer 
Interface} PCB. The printhead is connected to a flexible printed circuit 
(`flexiprint') that is an integral part of the {\bf Printer Driver} PCB, 
while the motor and switches connect to an edge connector at the rear of 
this PCB.

The printhead has 80 elements and prints a horizontal row of dots for up 
to 16 characters across the paper. The paper is then advanced by one dot 
line and the next row of dots for the line of characters is printed. This 
is repeated until the whole characters have been printed

\subsection{Printer Mechanism}
The printer is mechanically quite simple. The platen is a rubber roller 
at the front of the chassis, with a second shaft beneath it carrying 2 
belts that run along the bottom of the paper well and round idler rollers 
towards the rear. These 2 shafts are geared together by the gears on the 
right hand side of the machine. When the platen revolves, it feeds the 
paper through the printer. A new roll of paper is loaded by the belts 
which feed the free end of the paper towards the platen.

The mechanism is driven by a stepper motor at rear of the unit. This 
drives a pinion on the lower front shaft via a toothed drive belt. This 
pinion is free to rotate on the shaft, but it meshes with a gear on the 
platen shaft. Thus the motor drives the platen and advances the paper.

The printhead is pressed against the platen by spring, thus keeping the 
resistive heater elements in contact with the thermal paper. When the 
`Feed' key is pressed, the printhead is lifted off the paper by a linkage 
in the printer to reduce wear and to ease paper loading. The printhead 
operates a microswitch at the front of the unit when this occurs, this 
microswitch causes the electronic section to energise the motor.

The paper-out detector is simply a set of contacts that are held apart by 
the paper. When the paper runs out, a circuit is completed through these 
contacts.

\subsection{Printer electronics}
The electronic part of the printer consists of 2 main parts -- to drive 
the printhead elements and to drive the motor. There is also some 
control circuitry common to both sections.
 
We shall begin with the printhead driver. The I/O register in the 
processor is extended by a further 10 bit shift register consisting of U4 
and U2 on the {\bf Printer Interface} PCB, which are serially loaded with 
the {\bf I/O In} signal (which is, of course, the LSB of the I/O register 
inverted by U20d on the {\bf I/O Interface} PCB). This forms a 26 bit 
shift register which is loaded by the processor using 2 I/O instructions.

The 80 printhead elements are electrically connected as a 20*4 matrix, 
with diodes on the {\bf Printer Driver} PCB to prevent sneak paths. The 4 
rows of this matrix correspond to 4 quarters of line of dots that the 
printer is currently printing, the 20 columns corresponds to the 20 dots 
within that quarter. The 20 column lines are driven from 20 bits of the 
shift register. The top 10 bits of the I/O register in the processor are 
inverted and buffered, e.g. by U8a and  Q11. The 10 bits from the extra 
shift register are buffered, for example by U3a and Q10 (U3a is not an 
inverter, since the serial input to this extra shift register is inverted 
with respect to the I/O register). Thus the 20 {\bf Col} signals can 
individually controlled.

The row selection circuit is on the {\bf Printer Driver} PCB. Decoder U4 
decodes 2 of the bits of the processor I/O register and enables one of the 
driver circuits such as Q15 and Q1. This grounds one of the {\bf HDCom} 
signals. The decoder is enabled by a pair of signals {\bf PrtHdEn/} and 
{\bf PrtPulse/} from the {\bf Printer Interface} PCB. Both must be low to 
enable any of the elements in the printhead. When this occurs, one row of 
the electrical matrix can be selected and the elements in that row 
turned on by the bits in the shift register.

{\bf PrtHdEn/} is asserted by U7a on the {\bf Printer Interface} PCB when 
the {\bf PrtEn} signal is asserted by the {\bf I/O interface} PCB and the 
feed button is not pressed. If the paper has not run out, {\bf PrtClkEn/} 
will be low, enabling monostable U10. This monostable is triggered by {\bf 
PrtHdEn/}, inverted by U7c. U10 provides the {\bf PrtPulse/} enable 
signal.

The motor is advanced one step by the {\bf MotorClk} signal (we will see
how this actually drives the motor in a moment), which can be produced
either by the processor during printing, or by the printer electronics for
manual feed operations. During normal printing, {\bf Feed} is deasserted. 
The output f U9c on the {\bf Printer Interface} PCB thus goes low when the
output of U9a is high, that is when the last quarter of the line is
selected. When this occurs, the motor is advanced by the trailing edge of
{\bf PrtPulse/}, gated via U9b. 

For manual feeding. the microswitch in the printer mechanism applies 
24V to {\bf FeedSw}. Thus turns on Q24, asserting {\bf Feed}. U7a is 
inhibited, so the printhead cannot be driven. U9d's output is forced 
low, enabling U10 (even if the paper has run out, so that a new roll of 
paper can be loaded). U7d is enabled, gating the output of the astable 
multivibrator Q21, Q22 into U7c and thus repeatedly triggering U10. Thus 
the motor circuit is repeatedly clocked and the paper is advanced.

The same signals that trigger U10 also trigger the monostable U5b which 
has a much longer time constant. This provided an enable signal, {\bf 
MotorEn/}, to the motor drivers and reduces power dissipation by turning 
off the motor windings when the printer is not being used.

The motor driver circuit is on the {\bf Printer Driver} PCB. It consists
of the 2 JK flip-flops U3a and U3b. The outputs of U3a and U3b which are
in phase quadrature, are buffered and connected to the stepper motor
windings. If {\bf MotorEn/} is high then the `lower' transistor of each 
buffer is certain to be cut off (for example U2c will ground the base of 
the lower transistor of the {\bf MA} buffer under these conditions), thus 
ensuring that one end of each motor winding is floating. Therefore, as 
mentioned earlier, the motor windings then  carry no current.

The {\bf PrtFlag} signal to the {\bf I/O Interface} PCB is produced by 
U7b on the {\bf Printer Interface} PCB. It acts as a `ready' signal 
indicating the printer is ready of the next operation. Normally U5a has 
timed out, so {\bf PrtFlag} is produced by the trailing edge of {\bf 
PrtPulse/}. But when the last part of the pine is printed and the motor 
steps the paper on one line, U5a is triggered. This delays the {\bf 
PrtFlag} signal until the trailing edge of U5a's output, when it times out. 
This gives the mechanism time to move the paper before the next line of 
dots is printed.

When the paper runs out, the contacts in the mechanism apply 24V to the
{\bf PaperOut} signal. This turns Q23 on, forcing the output of U9d high
if the manual feed key is not pressed. The various monostables are now
inhibited, which disables the printhead elements, prevents the motor from
turning, and prevents {\bf PrtFlag} from occurring. The last is used to
indicate to the processor that there is no paper in the printer. As
mentioned earlier, the manual feed switch will enable U9d even when {\bf
PaperOut} is asserted, enabling the motor to be used to load the new roll
of paper. 

\section{HP9830 printer interface}
The printer interface located on the HP9830 {\bf I/O Backplane} PCB is 
similar in operation to an external interface plugged into one of the I/O 
connectors, and is quite simple

Select code 15 is decoded from the {\bf CO} outputs by U1a. Its output 
goes low when the printer interface is selected. When {\bf CEO/} is also 
asserted, the output of U2b goes high, clocking 7 bits of data from the 
I/O register into U4 and U5. The outputs of these latches are fed to the 
printer connector. 

The output of U2b is inverted by U2d and sets the flip-flop U3a, thus 
asserting {\bf PrtStb} via U2c. {\bf PrtFlg} from the printer clears U3a 
when the printer is ready for further data. 

The {\bf SI(O)} input to the I/O register is pulled low by U1b when the 
device is selected (that is U2a's output is high because that of U1a is 
low) and the printer is ready for more data (U3a is cleared).

The printer signals are routed through an edge connector on the top of 
the I/O backplane to the 19 pin MIL-C-26482 connector on the rear of the 
machine.


