![](http://datasheet.mmic.net.cn/10000/03-AP24XS_datasheet_1249528/03-AP24XS_5.png)
- 5 -
5
HOST PROGRAMMING
5.1 OVERVIEW
The Ap24XS interface has an 8k buffer to optimise throughput of printed data. This enables data to
be received into the buffer while previous lines are being printed, thus maximising print speed. The
buffer contents will be printed out automatically when a full line has been received (the line length
being dependent on the mechanism type and the current print mode). The buffer is cleared by a
CAN code or by a hardware reset. A partially full line will be printed on receipt of an appropriate
control code. Alternative printing modes including graphics, are invoked by 'Escape' sequences.
Each 'Escape' code sequence must be the first code in a line, i.e. it must immediately follow a valid
line termination sequence (CR or LF).
ASCII codes from 20 to FF are treated as printable characters. Codes from 00 to IF Hex are
reserved for control functions as follows:
LF (OA Hex)
Causes printout of buffer contents in selected print mode, with automatic
paper feed. If no printable characters have been received then just a paper
feed results.
VTAB (OB Hex)
Causes a fast feeding of 30 dot line pitches.
CR (OD Hex)
Behaves exactly like LF. The controller responds intelligently to
combinations of the LF and CR codes, providing an extra line feed only if
one or both of the codes is or are, repeated.
CAN (18 Hex)
Abort all printing immediately, clear the print buffer and revert to cold start
settings
ESC (lB Hex)
Causes the controller to expect the next code as a special parameter, with
its bits uniquely coded as follows:
When Bits 5 and 6 are zero:
Bit 0 (LSB)
0 for text mode
1 for data mode (inverted, reversed) printing
Bit 1
0 for characters
1 for graphics printing
Bit 2
0 for single width
1 for double width printing
Bit 3
0 for single height
1 for double height printing Bit 4 0 (except for self-test, see
below)*.
*The special combination 'ESC ESC' is used to initiate a self-test sequence, which results in a
printout of the character set.
The graphics bit is cleared to zero after each dot line (see section 4.2).
The print modes may be combined as required, for example double height and double width
inverted printing is perfectly permissible, but modes may not be mixed on one line.
When bits 5 and 6 are set, bits 4-0 take on different functions, by encoding in binary the number of
3 dot pitches the paper is to be fed.
Bit 5
0 for no fast feed
1 for fast feed
Bit 6
Must be set to 1
Bits 4-0
Binary count of number of steps.
For example, by sending 'ESC & H29' (binary 0010 1001) the controller will feed nine fast feed
steps each of three dot line pitches.