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 oinse
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:
All these lines remain in the stat they were at last, until new data is sent to the printer. At switch on,
or after pressng 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 frmo the printer, the Z80 instruction: IN A, (FB) - opcode DB FB; will put the
data into the accumulator. These bits are used:
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
turned off before attempting to detect the edge of the paper.
Some programs
Here are a few example programs for experimenting with. "Text Edit" (No. 1) uses the printer like a
typewriter except that it automatically prevents words from being chopped in half by the end of the
line.
Programs 2 and 3 are not specifically for the printer, but the graphics they produce on the screen are
quite effective when COPY is used. No. 2 takes up to 40 characters and enlarges them 4 times using
PLOT and the ZX81's built-in character set. This program runs very slowly! Two examples of pretty
pictures are plotted by the 2 programs given as No. 3, which may be easily modified to give other
(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.
(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