This page has been robot translated, sorry for typos if any. Original content here.

Reading payphone firmware

Connecting cards to a computer for reading and writing is mainly carried out through the LPT port.

We collect the reader circuit. (for 8 contact).

Connection diagram of cards to computer

OR according to the table (for 6 contact).



Where to connect

card pin

  1. VCC (power)

  2. RST (reset)

  3. CLK (clock pulses)

  4. GND (land)

  5. not used

  6. I / O (input / output)

one.     - + 5V

2     - 2 pin LPT

3     - 3 pin LPT

four.     - 25 pin LPT

6     - 11 pin LPT

Power supply via pulse diodes (anodes to the port) with 6-9 LPT contact, you can also take it from the first GamePort pin (the port for the joystick) or from the keyboard.

Work with software

Download 24 kb

So when everything is connected, you can start working with the software. If everything is connected correctly, the following will appear on the screen:

If all the data in the HEX codes have the value "FF" or in the hexadecimal number system "11111111", it means that something is incorrectly connected, or it doesn’t work well. On this I sieve my task in full, go ahead with you! This program is not only a simple Reader, it can also remove units from the map ...

  2. Physical ISO standard
The figure shows the numbering of the contacts of the chip card

ISO 7816-1 type


  1. Vcc + 5V

  2. R / W

  3. Clock

  4. Reset

  5. Gnd

  6. Vpp + 21V

  7. I / o

  8. Fuse

1- VCC (power)

2- RST (reset)

3- CLK (clock pulses)

4- GND (ground)

5- no use (not used)

6- I / O (input / output)

  What is written on the cards? (for St. Petersburg cards)

   the purpose of each bit recorded on the card.

The card uses only 16 bytes. All others are 0xFF.

Memory Card Examples

This card is 50 units over. The number is 0050415503.

It is valid until 09/30/98

E9, 30, FF, 01, F1, E2, 80, C0

00, 00, 00, 00, FF, 18, EA

This 400 unit card is also empty. No. 0400155921.

It is valid until 09/30/98

E9, 30, FF, 01, 88, A7, 9B, E8

00, 00, 00, 00, FF, D9, 79

Here is a map for 1000 units. There are 998 left. Number 1000013039.

It is valid until 12/31/99

E9, 30, FF, 01, F7, 3F, 59, DC

00, 01, 7F, 0F, 3F, FF, 68, 6B

Then I called on this map. There are 6 units left.

E9, 30, FF, 01, F7, 3F, 59, DC

00, 00, 00, 3F, FF, 68, 6B

Finally, it is over.

E9, 30, FF, 01, F7, 3F, 59, DC

00, 00, 00, 00, FF, 68, 6B

Field mapping

1. The first 4 bytes - some kind of identifier. On all cards

E9, 30, FF, 01.

2. The next 4 bytes are the serial number of the card. Placing the bits in bytes in reverse order, and then the bytes themselves, we get a 32-bit integer without a sign. For example, bytes F7, 3F, 59, DC with reverse order of bits look like EF, FC, 9A, 3B. Get the card number 0x3B9AFCEF or 1000013039 in decimal. It is easy to see that the number printed on the card always consists of 10 digits, and the first 4 digits are the capacity of the card.

3. The next 5 bytes - the number of units remaining on the card. The storage format is very interesting: the number of single bits in the byte is used, starting with the low. Accordingly, the value of byte 07 corresponds to 3 units, the value of 1F - five, and 7F - seven units. The maximum number of units stored in a byte is seven. Accordingly, the octal number system is used. Thus, bytes 00, 01, 7F, 0F, 3F correspond to 01746 in the octal system or 998 units in the decimal system. The maximum number of units can be 77777 in octal or 32767 in decimal.

4. The next byte is always FF. Looks like it is not used.

5. The last two bytes appear to express a CRC or other control code for the first 8 permanent bytes, since when spending units they do not change, but on

each card they own. While their appointment is not clear. It was found that the expiration date is not recorded on the card. Apparently, it is somehow related to the card number.

It is possible that a specific range of numbers correspond to each expiration date.

As already mentioned, out of 10 digits, the first 4 numbers express the card capacity. The remaining 6 do not identify the card uniquely, because over a million cards have already been issued. In total, with a similar numbering system, there may be 6 million maps:

* For 25 units with numbers from 0025000000 to 0025999999

* On 50 units with numbers from 0050000000 to 0050999999

* For 100 units with numbers from 0100000000 to 0100999999

* For 200 units with numbers from 0200000000 to 0200999999

* For 400 units with numbers from 0400000000 to 0400999999

* For 1000 units with numbers from 1,000,000,000 to 1,000,999,999