About the ZX Printer

The ZX Printer was Sinclair's answer to ZX81 and Spectrum owners that wanted a printer for their computer. Costing a fraction of other printers available at the time, it was an instant success.

Spectaculator emulates the ZX Printer at the hardware level for maximum compatibility. Output can be saved to disk as a Windows Bitmap (.bmp) file, copied to the clipboard or sent to a real printer.

General principle of operation

The printer functions in rather the same way as a TV, i.e. by scanning from left to right. A conductive stylus is pulled across the paper at high speed, and where a black dot is wanted a pulse of current is passed though the stylus. This evaporates the aluminium coating on the paper, and allows the black backing to show through. To avoid the need to return the stylus quickly to the left hand edge of the paper, there are in fact two styli, mounted on a moving belt, which follow each other in quick succession. The belt and the paper feed roller are both driven continuously whilst printing; so that when the next stylus comes round the paper has been moved up ready for the next line.

In order that the styli always stop off the paper, the BASIC commands slow the motor down for the last two scans before stopping - this makes sure that graphics always "join up" if done in several goes, and this feature should be put in any machine code program that requires the printer to stop whilst the computer thinks about the next line. At full speed, each pen is on the paper for about 32ms, and off it for about 16ms.

Since the speed of printing can vary, an encoder disc is used to give 256 pulses across a 92mm print width (allowing 4mm margins). These pulses are synchronised with the stylus hitting the paper so that the printing is always vertical.

There is about 60µs between the starts of successive pulses at full speed.

The interface

The printer is wired as a Z80 I/O port, selected by A2 being at a low level - no other address lines are recognised. So to send information to the printer, use the Z80 command

OUT (FB),A - opcode D3 FB

assuming the data is in register A. The data bits have the following meanings: (D2) High level means stop the motor, low means start it.

(D1) High level means put the motor on slow speed - this line is overridden by D2 being high. (D7) High level applies power to the stylus.

All these lines remain in the state they were at last, until new data is sent to the printer. At switch on, or after pressing the feed button, D1 and D7 are set low; D2 is left high once feed is finished. The other data lines aren't used.

To fetch information from the printer, the Z80 instruction: IN A, (FB) - opcode DB FB; will put the data into the accumulator. These bits are used: (D6) will be erased as low if the printer is there, high if it isn't, and is used solely to check the printer is connected.

  • (D0) This line is the signal from the encoder disc.

  • (D7) This line is high when the stylus hits the paper.

D0 and D7 are both latched so that they remain high until the computer writes something to the printer. So even if you don't make use of the information you've read in, you should output instruction (with appropriate data) to reset the latches until the next signal. These bits may be in either state on switch on, and aren't affected by the feed button.

The paper detect signal is also used internally by the printer to make sure that the styli stop off the paper. Note that if power is applied to the stylus, the paper signal will go high even if the printer is between scans, and so the stylus must be turned off before attempting to detect the edge of the paper.