We launch a dot matrix printer from an old bank terminal

Tomcat

Professional
Messages
2,378
Reputation
4
Reaction score
407
Points
83
Greetings to all!

Not long ago I already talked about what printers were like at the beginning of the era of thermal printing. And in that article I mentioned that such devices were used in conjunction with VeriFone payment terminals.

Alas, I was unable to find just such a printer, so today we’ll talk about its equally popular matrix brother in this area, which also turned out to be extremely interesting.

6xkfr5moco93lbzxm2ak3fxnpx4.jpeg


So, in today’s article we’ll talk about how such a printer works and works. Let's figure out how to connect it to a regular computer. As usual, there will be a lot of interesting things.

❯ What am I talking about?​


A long time ago, somewhere in the mid-eighties, there were no simple and cheap thermal printers. Therefore, checks were printed on matrix copies. I have already demonstrated one of these printers (as part of the Tranz 460 terminal) in passing in one of my articles. The copy printed quite well (and also pleased with incomparable sounds), but I wanted a free-standing one, and preferably in the same design (underlay printers are essentially smaller analogues of “large” analogues, but more on that later).

And just such a device came into my hands, so I can try to connect it and start it up.

❯ Equipment overview​


lry1z4bse8t2jonohmyzgazabmg.jpeg


And here is the copy itself, VeriFone Printer 250. It is called that, however, only in its own instructions and in trade catalogs; in all other places it is simply called P250.

2edys4us52rzipnd-ums4wmzrni.png


Produced since the early nineties and is the successor to the older P200, it was used in conjunction with most older VeriFone terminals. Devices such as Tranz (pictured), Omni (on KDPV) were designed to work with it out of the box, there was even a corresponding library as part of the SDK. Even in the later Omni-3350, Omni-3750, equipped with thermal printers, support for external matrix printers was not completely abandoned.
The printer itself is very similar to a modern one and practically does not give away the matrix nature to the average person. It has two covers on top - one for a roll of ribbon, and under the other there is a cartridge. Two indicators, paper feed button, power switch.

ds4k-p1b8t2vt9yva6lk0uy2ehi.jpeg


Below there is nothing interesting, except for P/N. Many modifications of this printer were produced, which, although they were identical in appearance, were completely different in function.

ukbiz4rzhbntmolhdr7h12giu7q.jpeg


There are two miniDIN connectors on the back - power and RS-232.

uyndxhqmwwsycm5omzxlvll_rbk.jpeg


Printer with covers removed.

oip8hxbza8lzchpdjaocgyh-uvg.jpeg


And here is the paper presence sensor window. It is made in a very unique way - it does not control the end of the tape, but simply that the roll is close to ending. If the paper runs out, nothing will prevent the mechanism from knocking all the text into the empty space. Also, this sensor does not work if the cover is removed - due to the incoming light, the printer begins to think that there is always paper.

f0ftvbc9l1ivpthoi5ztr5gdq80.jpeg


Power unit. Very harsh, transformative. It also shows the pinout of the connector.

❯ Entrails​


juoqafnhu2f62zvhfmi1a33f6j4.jpeg


Of course, I disassembled the printer. There is nothing complicated about this, just take a wide flat-head screwdriver and insert it into the two slots in the front, and then carefully remove the cover. It comes with wires from the toggle switch and a very short cable to the display board, which also needs to be carefully disconnected. That's all.

1e_fkg_eheti-m7rn0ineyuefs8.jpeg


Let's remove the mechanism. The printer is built on a Z8 microcontroller. Unlike what is installed in the once mentioned PrintPak, the local chip is UV erasable, which even in theory makes it possible to change fonts. The mechanism is mounted on four self-tapping screws through rubber gaskets, similar to those used to dampen vibrations in computer optical drives.

❯ Consumables​


Let's deal with paper and cartridge.
The tape used is Epson ERC-23BR. You can, of course, insert another one (ERC-23P, ERC-23B), but then the possibility of color printing will disappear.

fhdxoig30cp1yghwkztatvcpw9o.jpeg


VeriFone also sold branded cartridges. I don't think she made them herself, most likely some kind of OEM. The ribbon is red and black, which makes it possible to print in two colors.

oyvllpyogwcgnre_hdgzq_mr4bq.jpeg


A roll of paper. In the era of thermal printers, its width looks non-standard - 76 mm. An eighty-millimeter roll does not fit into the printer.

7jsegohydgzdcz4weg2vrde6lb4.jpeg


The paper itself is two-layer, and the bottom layer is sensitive to shock (the photo shows another roll, where I ran my fingernail across the top layer, which imprinted on the bottom). This made it possible to print two copies of the check at a time, with one remaining with the seller and the other given to the client.

❯ Механизм​


This printer operates in a very different way from the matrix printers we are used to.

c3h0du8bjsgjdsxynjw4u_iran4.png


Here, for example, is a lining printer, Star SP298.

ri4u-mbdqrxqztpscw7pxpvctm8.png


Despite the fact that this is a receipt printer, inside it is exactly the same design with two stepper motors, a paper feeding mechanism, a movable head with nine needles... A similar mechanism was in the first domestic electronic cash registers.

yxqqspxb5howafbreqxvsxohc8m.png


Here the device is completely different: the needles in the head are located strictly horizontally. Everything is controlled by a simple commutator motor, which rotates both the paper feed roller and the worm shaft that moves the head. The gearbox is designed to move the paper by a distance of one pixel in one pass of the head.

fosnhvn8y3k0nwquolditfxhfw8.png


The design itself is called a “shuttle impact printer” (line matrix printer), there was even a short article about it here. Large format printers were also produced in a similar design, usually these are large and rugged devices for huge print volumes. Here 's a little about servicing such monsters. Compared to traditional designs, they have much faster print speeds (my particular copy is close to older thermal printers). However, the high price and noise, even by the standards of dot matrix printers, greatly limit their use.

valabphxvimamoszz7_ztbqgjkc.jpeg


g-lump9sg35zas0vqsqlqhqgswq.jpeg


Color printing is implemented simply - the cartridge is simply tilted by an electromagnet, causing the head to hit the other half of the tape. The photo shows both positions.


By the way, some desktop printers (such as Epson LX-300+) had the ability to print in four colors at once (after adding a special upgrade kit called Color Kit). The principle was similar - a stepper motor, synchronized with the rest of the mechanism, tilted the cartridge, placing the desired part of the tape under the head. However, this could not be called a full-fledged color printing; when several colors were passed over one place, the tape became dirty with ink that was not yet completely dry and the following sheets became dirty. However, the device was ideal for printing color text or, for example, color graphics.

❯ First start​


So, we figured out the device. You can try turning it on.

dkmrpkocniuzfzmpfbgz2pd_2a8.jpeg


We load the paper and turn it on again with the feed button held down. The printer will start printing the ASCII table.
Works.

❯ Connecting to a computer​


In general, these printers were intended to work with terminals. But, of course, nothing prevents us from connecting it to a PC.

zknbwv-hii15ti5sv0qhwcj1fbc.png


The pinout turned out to be like this. The cable I had once soldered for flashing the Tranz 460 terminal came to the printer.
By the way, this is how it happens: in the Tranz manual the pinout is modestly omitted (then I had to dial everything myself), but here it is given.

7ro3qikrlzebb9zqyb9pyyhdlz8.png


In the bowels of the printer, next to the mechanism, there are DIP switches. We remember this and do not forget to set the necessary parameters. I left the default values: 9600 baud, 7 bits, even.

708fut7ghzuzuxus9l_ltwkui8s.png


The printer can be connected to any computer with MS-DOS/Win9x, for which you need to install the “Generic/Text Only” printer driver on this COM port and enable roll feeding in the settings. In the same way, you can print from any text editor under DOS, which supports continuous printing and setting a limit on the number of characters per line. For example, you can use the well-known “Lexicon”.

But, of course, if everything was limited to connecting a printer to an old computer, then there would be no article. In fact, this device can do much more. Well, we’ll figure out how to use it.

❯ Printer protocol​


sgj9lsvw_krvfhxb2slubvgozs0.png


The instance, like many other printers, is controlled by ESC sequences. However, this is not the ESC/P or ESC/POS commonly used in such printers. The protocol itself is described in sufficient detail in a certain “VeriFone Printer 250 Reference and programmer's manual”.

7q5vbj5j080gip-5a9cee-32ses.jpeg


To check, we try to send some string, followed by the LF character (0x0A). The printer will print it immediately.

When printing, huge vertical margins are obtained, which should also be taken into account. In order to automatically feed the paper to the end, you must send the FF character (0x0C).

v34f_8pqrvqoikkjlwbsrrbyf8y.jpeg


You can’t get rid of this even with a strong desire, this is the design. The photo shows how far the paper travels from the head to the tear-off toothed bar.

Of course, simply writing commands into the terminal is not so interesting, so I even wrote a program for this.

Now that you are sure that the printer is printing, you can try other commands.

❯ Text size and color​


The printer allows you to print in double width or double height. And if the width is switched with a single byte, then a separate ESC sequence is required to change the height.

The functions for setting these parameters turned out like this:

Code:
void setHeight(int height) {
WriteCOM(0x1B);
WriteCOM(0x66);
if(height == 0) {
    WriteCOM(0x30);
    WriteCOM(0x30);
}
else if(height == 1) {
    WriteCOM(0x31);
    WriteCOM(0x31);
}
WriteCOM(0x3B);
}

void setWidth(int width) {
if(width == 0) {
    WriteCOM(0x1F);
}
else if(width == 1) {
    WriteCOM(0x1E);
}
}

In both cases, 0 is normal size, 2 is large.

kvefmd9l2pftzuiyjwnepv8ribe.jpeg


Here is an example of printing with regular and double width.

❯ Russian font​


ke5r8rwj9bz5r6sohenk3nqdglo.png


The printer has a separate encoding command. But there is no Russian there.

7bf868qcluuu90q83efgoi351yk.png


With the Russian font everything is much more interesting; a separate code table is used for it. Moreover, it does not correspond to 866, or 1251, or any other. These are simply all the Cyrillic characters that are not in the Latin alphabet (such as E, Yu, Ya, Y, I, P, Ts...), written in order.
Accordingly, to print a line in Russian, it is necessary to enter all the characters similar to Latin ones, and with a preliminary selection of the encoding those that are not in ASCII.

7xqyau6fqg3uudhdusp0jpzko40.png


What complicates the situation is that the letters are scattered haphazardly, that is, a banal shift of the character code in the table cannot be done. By the way, this list shows the addresses of symbols in the printer ROM, but when printing they lie at 20h:40h. And yes, that's all this printer is capable of; printing lowercase letters is not supported.
By the way, doesn’t anything bother you? Yes, there are no letters “З” and “Ч”, but instead of them for some reason there are such truly Cyrillic symbols as “J”, “U”, “/”, as well as those duplicated from the Latin alphabet A, E, T and others. Anyway.

So, this is the final function:

Code:
void printCyrillic(string data) {
int len = data.length();
if(len > 40) len = 40;
for(int i = 0; i < len; i++) {
    if(uint8_t(data[i]) >= 0xA0) {
            WriteCOM(' ');
    }
    else if(uint8_t(data[i]) >= 0x80 && uint8_t(data[i]) <= 0x9F) {
            loadCyrillic(uint8_t(data[i]));
    }
    else {
            WriteCOM(uint8_t(data[i]));
    }
}
WriteCOM(0x0A);
}

The principle is very simple: if the character is from ASCII, we load it like this, if it is Cyrillic, then we call a separate function, otherwise we simply send a space instead of this character (yes, the printer cannot print the SCP Foundation style character █ either).
I thought for a long time about how to load the Cyrillic alphabet into the printer buffer itself, but I never came up with something better than manually entering the codes of all the characters:

Code:
void loadCyrillic(uint8_t symbol) {
switch(symbol) {
case 0x80:
    WriteCOM('A'); //А
    break;
case 0x81:
    WriteCOM(0x03);
    WriteCOM(0x21); //Б
    WriteCOM(0x0F);
    break;
case 0x82:
    WriteCOM('B'); //В
    break;
case 0x83:
    WriteCOM(0x03);
    WriteCOM(0x37); //Г
    WriteCOM(0x0F);
    break;
case 0x84:
    WriteCOM(0x03);
    WriteCOM(0x2F); //Д
    WriteCOM(0x0F);
    break;
case 0x85:
    WriteCOM('E'); //Е
    break;
case 0x86:
    WriteCOM(0x03);
    WriteCOM(0x2F); //Ж
    WriteCOM(0x0F);
    break;
case 0x87:
    WriteCOM('3'); //З
    break;
case 0x88:
    WriteCOM(0x03);
    WriteCOM(0x25); //И
    WriteCOM(0x0F);
    break;
case 0x89:
    WriteCOM(0x03);
    WriteCOM(0x33); //Й
    WriteCOM(0x0F);
    break;
case 0x8A:
    WriteCOM('K'); //К
    break;
case 0x8B:
    WriteCOM(0x03);
    WriteCOM(0x2E); //Л
    WriteCOM(0x0F);
    break;
case 0x8C:
    WriteCOM('M'); //М
    break;
case 0x8D:
    WriteCOM('H'); //Н
    break;
case 0x8E:
    WriteCOM('O'); //О
    break;
case 0x8F:
    WriteCOM(0x03);
    WriteCOM(0x2A); //П
    WriteCOM(0x0F);
    break;
case 0x90:
    WriteCOM('Р'); //Р
    break;
case 0x91:
    WriteCOM('C'); //С
    break;
case 0x92:
    WriteCOM('T'); //Т
    break;
case 0x93:
    WriteCOM(0x03);
    WriteCOM(0x28); //У
    WriteCOM(0x0F);
    break;
case 0x94:
    WriteCOM(0x03);
    WriteCOM(0x24); //Ф
    WriteCOM(0x0F);
    break;
case 0x95:
    WriteCOM(0x03);
    WriteCOM(0x3D); //Х
    WriteCOM(0x0F);
    break;
case 0x96:
    WriteCOM(0x03);
    WriteCOM(0x39); //Ц
    WriteCOM(0x0F);
    break;
case 0x97:
    WriteCOM(0x03);
    WriteCOM(0xB9); //Ч
    WriteCOM(0x0F);
    break;
case 0x98:
    WriteCOM(0x03);
    WriteCOM(0x2C); //Ш
    WriteCOM(0x0F);
    break;
case 0x99:
    WriteCOM(0x03);
    WriteCOM(0x32); //Щ
    WriteCOM(0x0F);
    break;
case 0x9A:
    WriteCOM(0x03);
    WriteCOM(0x3F); //Ъ
    WriteCOM(0x0F);
    break;
case 0x9B:
    WriteCOM(0x03);
    WriteCOM(0x35); //Ы
    WriteCOM(0x0F);
    break;
case 0x9C:
    WriteCOM(0x03);
    WriteCOM(0x30); //Ь
    WriteCOM(0x0F);
    break;
case 0x9D:
    WriteCOM(0x03);
    WriteCOM(0x20); //Э
    WriteCOM(0x0F);
    break;
case 0x9E:
    WriteCOM(0x03);
    WriteCOM(0x22); //Ю
    WriteCOM(0x0F);
    break;
case 0x9F:
    WriteCOM(0x03);
    WriteCOM(0x3C); //Я
    WriteCOM(0x0F);
    break;
}
}

We check, and here is the result:

l8oynwqz3tkidjryzknwacdga2q.jpeg


❯ Test commands​


lv3tnt7use01owy1u6yzoatuivu.png


In addition to directly managing printing, there are several service sequences, in particular, requesting status or information about the printer. Alas, they are relevant only for some revisions, but my printer does not respond to them.

❯ Something like that​


So, the printer definitely turned out to be an extremely interesting device, not only in terms of design, but also in terms of control (since the device was created long before the mass distribution of ESC/POS). Alas, it won’t be possible to use it constantly due to the now limited distribution of consumables for it. So far I haven't been able to get the same new cartridge anywhere.
In newer terminal models, VeriFone switched to the well-known thermal printing with a fixed head, after which external matrix and thermal printers finally became history.
So it goes.

Links​

 
Top