AY-Track: "Blue moon" in small remix:)
__________________________________________
(C) Seiko EPSON corp.
(C) ZK System / Excess team
__________________________________________
Printer and ZX-Spectrum
One of the more common devices to produce hard copy
documents are printing. They exist a great many, however, is
the standard command system printer family Epson (tm).
Typically, the printer connects to your computer via the
connector interface concurrent (LPT).
Returning pin signal H Explanations
signal pin
January 19 / STROBE O signal GATE means reading the data.
The width of the signal should not be
more
0.5 microseconds at the receiving
terminal.
February 1920 DATA0 O data signals are parallel
March 21 DATA1 O parallel to the bits 0 to 7, respectively
April 22 DATA2 O High level corresponds to logic 1,
May 23 DATA3 O and low - logic 0
June 24 DATA4 O
July 25 DATA5 O
August 1926 DATA6 O
September 1927 DATA7 O
Oct. 28 / ACKNLG I signal lasts. 12 microseconds. Low level
means that the data taken and the
principles ter is ready to receive
further information mation.
November 29 High BUSY I signal means that the principle
ter can not accept data. Signal
is high
in the following cases:
1) During the reception of data.
2) During the printing process.
3) If an error occurs.
December 30 PE I High Voltage means
that the printer out of paper.
13 ----- ------ - is powered +5 V,
Resistance of 3.3 ohms.
14 ----- / AUTO O at low signal levels paper
FEED XT automatically translated into one
line after printing.
15 ----- NC - Not used.
16 ----- 0 V - logical grounding.
17 ----- CHASSIS - grounding on the chassis of the printer
GND is isolated from the logical.
18 ----- NC - Not used.
19-30 ----- GND - Twin returning signal
grounding.
31 ----- / INIT O When the signal becomes
low, the printer controller sbrasy
is called a state of loading, and
buffer
Print is cleared. Normal levels
signal - high, wide signal
must be over 50 microseconds. on the
principle enacting the terminal.
32 ----- / ERROR I level becomes low when:
1) The printer paper ends.
2) The printer is disconnected from
the line.
3) If an error occurs.
33 ----- GND - Same as 19-30
34 ----- NC - Not used.
35 ----- ------ - is powered +5 V,
Impedance 3.3 kOhm.
36 ----- / SEL IN O DC1/DC3 code is valid when
this signal is "high" level.
In Speccy LPT interface has several
simplified scheme. For the exchange of used
eight data lines (D0-D7), the line signal
Sampling data (Strobe), the line survey of employment printer
(Busy), and of course neutral conductor (GND), sometimes that
is not quite sure, the line / ERROR.
Speccy Printer
8
D0 ... D7 ============/========== D0 ... D7
/ STROBE ----------------------- / STROBE
/ ERROR ----------------------- / ERROR
BUSY ----------------------- BUSY
GND ----------------------- GND
The printer consists of a computer
with its RAM, ROM and CPU, which
manages the exchange of information, its processing, moving the
print head, vertical motion plate and, of course, printing
needles.
In the printer's RAM set aside a small buffer
which are introduced from outside the data that
to print. Loading data
printer as follows:
On the data line LPT port output
required bytes, and then to check
state line BUSY, if it is active,
this means that the printer buffer is full or an error
occurred. If BUSY is not active, the printer is ready to
receive the next byte of data. And so, as a byte has already
been formed, it remains to confirm strobe pulse on line /
STROBE.
For the interface ZX-Lprint III driver will
following form:
org # 5b00
nop
jr detect
jr init
jr output
detect ld b, 0; Checker
; Availability of the printer and
dlp in a, (# 7b); his willingness to
; To work
and # 80
ret z
djnz dlp
ret; if the output of A = 0,
, Then the printer is ready
init nop; usually anything here
nop; do not write
output push af; program output
; Bytes to the printer
out (# fb), a; expose bytes per
; Data line LPT
busy call # 1f54; poll keys BREAK.
; It is necessary to
jr nc, error; avoid freezing
; Error.
in a, (# 7b); checking line BUSY
rlca
jr c, busy; if busy, then wait
, Until a
pop af
out (# fb), a; Reset Strobe
out (# 7b), a; Enhanced Strobe
out (# fb), a; Reset Strobe
and a; normal output
; From the program
ret
error pop af; output-loaded
; CF flag
scf; if the error is.
ret
Some printers are very sensitive
to the duration of the signal Strobe. For example,
for my Epson (tm) LX-800 (tm) signal
Strobe is activated on rising or falling edge, and for the
normal operation Strobe signal should be formed as follows:
...
out (# fb), a
out (# 7b), a
...
In this case, the first byte after the introduced
turn on the printer will be ignored!
To avoid the loss of a logical chain
must first send some
harmless single-byte command, for example,
BEL (# 07) - beep.
When writing a driver for the ZX-Lprint
III must be remembered that the team is in a,
(# Fb) connects ROM ZX-Lprint III, and in
a, (# 7b) - disables.
Next, bring a description of the commands Epson (tm)
compatible printers. Some printers may not work command setup
character and work with NLQ fonts. Team
ESC means that the team will be ESC n
have the form # 1B, n.
1. Work printer.
ASCII HEX Description of
40 ESC @ Initialize printer
DC1 11 Select Printer
DC2 13 Deselect printer
ESC s 1 / 0 73 / off half speed
ESC <3C Selecting unidirectional print (for the first line)
ESC U 1 / 0 55 / off unidirectional printing
ESC in August 1938 to disable certain lack of paper
ESC in September 1939 Insert definition of lack of paper
ESC EM n 19 control zagruzkivygruzki Paper
n = "0": Disabled
"1": Select the receiver 1
"2": Select the receiver 2
"4": Included
"R": Unload the sheet
ESC = 3D Set MSB to 0
ESC> 3E Set MSB to 1
ESC # 1923 Disable MSB control
BEL 07 Wake
2. Data management.
ASCII HEX Description of
CR 0D carriage return
CAN 18 Cancel line
DEL 7F Delete character
3. Vertical movement.
ASCII HEX Description of
FF 0C Form feed
ESC C n 43 Set page length in lines n = 1-127
ESC C 0 n 43 Set page length in inches, n = 1-22
ESC N n 4E Installation skip perforation n = 1-127
ESC O 4F Cancel skip perforation
LF 0A Newlines
ESC 0 3 Line Spacing 1 / 8 in.
ESC January 31 Line spacing 7 / 72 inches
ESC February 1932 Line Spacing 1 / 6 inch
ESC 3 n 33-inch line spacing n/216 n = 0-255
ESC A n 41-inch line spacing n/72 n = 0-85
ESC J n 4A Newline at n/216 inch n = 0-255
VT 0B Vertical tab
ESC B nn 42 Set vertical tabs. Up to 16
TAB points (1-255) in ascending
order, the last parameter should be 0.
ESC B 0 clears all tab stops.
ESC b nn 62 Set vertical tabs in channels.
ESC b c n1 n2 ... n16 0. c = 0-7
ESC / c 2F Select vertical tab channels for c = 0-7.
4. Horizontal movement.
ASCII HEX Description of
ESC a n 6C Set left margin n = number of columns
ESC Q n 51 Sets the right margin n = number of columns
BS 2008 Backspace character
ESC $ n1 n2 24 Set absolute horizontal position
n = (n1 + n2 * 256) / 60 inches.
n: the print at a distance of n/60 inch
from the left margin.
ESC / n1 n2 5C Set relative horizontal position
n = (n1 + n2 * 256) / 120 inches
n: transfer printing position on n/120 inches.
If the transfer is to the left, subtract it
number of 65536.
HT 09 horizontal tab.
ESC D nn 44 Set horizontal tab to 32 points
(1-255) in ascending order.
5. Print styles.
ASCII HEX Description of
ESC x n 78 Select NLQ or Draft
n = 0: Draft
1: NLQ
ESC kn 6B Font selection of high-quality printing
n = 0: Roman
1: Sans Serif
ESC! n 21 Select character set
n = bit 0: 10 znd/12 ZnD
1: proportional
2: Sealed
3: Dedicated
4: double whammy
5: double width
6: italic
7: Underline
6. Step size and sign.
ASCII HEX Description of
ESC P 50 Selecting 10 ZnD
ESC M 4D Mode Selection 12 ZnD
ESC p 1 / 0 70 Bklvykl proportional mode
SI 0F inclusion of dense print
ESC SI 0F off dense print
DC2 12 Cancel condensed mode
SO 0E Enabling double-width
(One line)
ESC SO 0E Enabling double-width
(One line)
DC4 14 off double-width mode
(One line)
ESC W 1 / 0 57 / off mode, double width
ESC w 1 / 0 77 / off mode, double width
7. Printing Enhancements.
ASCII HEX Description of
ESC E 45 incl. Print mode selection
ESC F 46 Off. Print mode selection
ESC G 47 incl. print mode in two passes
ESC H 48 Off. print mode in two passes
ESC S0 53 incl. printing superscripts
ESC S1 53 incl. Print subscripts
ESC T 54 Off. Print Indexes
ESC April 1934 On. italic
ESC May 1935 Off. italic
ESC - 1 / 0 2D / off underline mode
ESC an 61 Font Alignment
n = 0: Left
1: In the center
2: Right
3: The Format
ESC SP n 20 Installing the distance between symbols
n = 1 / 120 inch gaps (1-127) to the right of
each character
8. Symbol Table
ASCII HEX Description of
ESC tn 74 Select character table
Select Table n, assigned to the command ESC (t
n = 0,1,48, or 49
ESC R n Select 52 international character set n =
0: USA 7: Spain 1
1: France 8: Japan
2: Germany 9: Norway
3: England 10: Denmark 2
4: Denmark 1 11: Spain 2
5: Sweden 12: Latin America
6: Italy
ESC June 1936 Extension of the press code, allows
print codes 128-159 as symbols
ESC July 1937 Off. ESC 6
ESC (t nn 28 74 Select character table ESC (t 3 d1 d2 d3
Assigns a character table with d2 d3 table
ESC t installed in accordance with the d1
d1 = 0: Set the table of selected ESC t 0
d1 = 1: Set the table selected ESC t 1
d2 d3 Character tables
0 0 Italic
1 0 PC 437 (U.S., Standard Europe)
14 0 PC 866 (Russian)
15 0 PC 869 (Greek)
32 0 Bulgaria
9. User-defined characters.
ASCII HEX Description of
ESC 'nn 26 Define user-defined characters
ESC '0 n1 n2 a1 data
n1 = ASCII code of first character
n2 = ASCII code of last character
a1 = attribute byte specifying the width and
ispolzueiye needles
data: the data symbol
ESC: 0 n 0 3A Copy the characters into RAM from ROM
n = 0: Roman
n = 1: Sans Serif
ESC% n 25 Select character set
n = 0: Normal collection
1: User set
ESC I n 1949 Extension of pechatyemyh codes
Decimal codes from 0 to 31 and from 128 to 159
n = 0: Nepechatyemye codes
1: Printable codes for user
Character
10. Schedule.
ASCII HEX Description of
ESC K n1 n2 4B incl. mode of normal density
ESC K n1 n2 data
n = n1 + n2 * 256
ESC L n1 n2 4C On. regime of double-density
ESC L n1 n2 data
ESC Y n1 n2 59 incl. mode dual-density, high speed
ESC Y n1 n2 data
ESC Z n1 n2 5A On. mode quadruple density
ESC Y n1 n2 data
ESC * mn 2A Select graphics mode
ESC * m n1 n2 data
Graphics mode code m DPI
Normal density ESC K 0 60
Dual density ESC L 1120
High speed. DD * ESC Y 2120
Quad density * ESC Z 3240
CRT is not an April 1980
Plotter (1:1) there is no May 1972
CRT 2 no June 1990
Plotter (1:2) No 7144
* Related terms can not be printed.
ASCII HEX Description of
ESC? sm 3F Reassign graphics mode
ESC? s m
s = K, L, Y, or Z
m = 0-7
m: to change the graphics mode m = ESC * m
ESC ^ 5E Selecting the charts with nine pins
ESC ^ m n1 n2 data
m = 0: Normal density
1: Double density
n = n1 + n2 * 256
data = (n * 2)
It should be noted that the introduction of buffer
Printer information will be intensified
Only after will be sent to command a carriage return CR (# 0D).
This must be for teams of data management buffer printer CAN (#
18) and DEL (# 7F).