About
Community
Bad Ideas
Drugs
Ego
Erotica
Fringe
Society
Politics
Anarchism
Central Intelligence Agency (CIA)
Corporatarchy - Rule by the Corporations
Economic Documents
Federal Bureau of Investigation (FBI)
Foreign Military & Intelligence Agencies
Green Planet
International Banking / Money Laundering
Libertarianism
National Security Agency (NSA)
Police State
Political Documents
Political Spew
Right to Keep and Bear Arms
Terrorists and Freedom Fighters
The Nixon Project
The World Beyond the U.S.A.
U.S. Military
Technology
register | bbs | search | rss | faq | about
meet up | add to del.icio.us | digg it

What you need to know about electronics telecards


=================================
What you need to know about electronics telecards
=================================

(C) Stephane BAUSSON - (1993-1994)
Version 1.09 (Last revised: 09-07-1994)

Email: [email protected]

4, Rue de Grand
F-88630 Chermisey
France

Phone: +33 29.06.09.89 (weekends only)

---------------------------------------------------------------------------
>> Any suggestions or comments about phonecards and smartcards are welcome <<
---------------------------------------------------------------------------

This file is archived at
nic.funet.fi:/pub/doc/telecom/phonecard/chips

Thanks to the following people:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
XRed [email protected]
Proux Jean-Philippe ## [email protected]
Tomi Engdahl ## [email protected]
Gerrit Telkamp ## [email protected]
Martin Schulte ## [email protected]
Georges Zotos ## [email protected]

Document History:
~~~~~~~~~~~~~~~~
Version 1.09 : Spanish card reading.
Version 1.08 : Modification of the octal stage counter for greek cards.
Version 1.07 : Modification of the 5 stage octal counter for 128 bit
cards.
Version 1.06 : Schematic of a new reader.
Version 1.02 : Introduction of the German cards.
Version 1.00 : First writting of the document.

Glossary of terms:
~~~~~~~~~~~~~~~~~~
TBC : to be confirmed
TBD : to be defined
-------------------------------------------------------------------------------

* Content *
~~~~~~~~~~~

I ) The cards from Gemplus, Solaic, Schlumberger, Oberthur:

1.1 - Introduction:
1.2 - SCHEMATICS of the chip:
1.3 - PINOUT of the connector:
1.4 - Main features:
1.5 - TIME DIAGRAMS:
1.6 - Memory Map for cards from France and Monaco:
1.7 - Memory Map for cards from Andora, Czech, Finland, Gabon, Ireland,
Ireland, Mexico, Norway, Portugal,Sweden:
1.8 - Memory Map for cards from Spain:

II ) The cards from ODS: (German cards)

2.1 - Introduction:
2.2 - Pinout:
2.3 - Main features:
2.4 - Time Diagrams:
2.5 - Memory Map:

2.5.1 - Memory Map for 5 satge octal unit counter:
2.5.2 - Memory Map for 4 satge octal unit counter:

2.6 - Electrical features:

III) Schematics of Readers:

3.1 - Reader 1:
3.2 - Reader 2:

IV) The program:

-------------------------------------------------------------------------------

I ) The cards from Gemplus, Solaic, Schlumberger, Oberthur:
(French cards)

==============================================
========================

1.1 - Introduction:
~~~~~~~~~~~~

Since the middle of 80's have appeared a new generation of cards ( the
smart-cards or chip cards ) that have replaced most of the magnetics cards
applications notably for telecom payement and also for credit cards. These
cards are far more secure than the magnetics cards, and there are several kind
of cards following the application. The simplier ones are the Simple Memory
cards like the one used as Telecard for the telecom payement in the public
phone-booths ( Generaly all the memory content is readable, and there is a
maker-area that is unwritable ) , then there are more sofisticated cards:

Memory Cards with some area read protected by a key, these cards can contain
some private informations in the read-protected area. At the end there are
microprocessor-cards (cards working following the ISO-7816 protocol), that are
the safiest ones since these cards have their own internal Operating System
that prevent I/O if the Pin code has not been entered in the cards before
( These cards are used when confidentiality is needed, like in bank cards,
crypted TV access cards, health cards, etc ... ).

About telecards, even if these cards are the less safe ones, don't think
that you are going to phone freely for that, in fact no. All the data are
readable since there are no confidential data inside, the the cards are well
done enough to be very secure for the payement of telecom communications in
public booth.

So, what is a phonecard exactly ? In fact generaly it's a 256 bits EPROM
( French likde cards ), or a 128 bits EEPROM (German like cards) with a serial
output and some other control pins.

Then why can it not be refilled ? Well, indeed to refill the card you
will have to erase the cards with UV, knowing that the cards is coated in UV
opaqued resin that prevent UV from reaching the silicium chip, and even if you
could to erase the chip you will have to program the manufactuer area that is
write-protected by a lock-out fuse that was fused after the card programming in
factory.

Neithertheless it can be very interesting to study how these cards work,
to see which kind of data are inside and how the data are maped inside or to
see how many units are left inside for exemple. Besides there are a great
number of applications of these cards when there are used (only for personal
use of course) , since you can use them as key to open a door, or you can also
use them as key to secure a program, etc ....

French Telecards have been created in 1984 and at this time constructors
decided to build these cards in NMOS technology but now, they plan to change by
1994 all readers in the public booths and use CMOS technology. Also they plan
to use EEPROM to secure the cards and to add many usefull infornations in, and
you will perhaps use phone cards to buy you bread or any thing else.

These cards are called Second Generation Telecards.

1.2 - SCHEMATICS of the chip:
~~~~~~~~~~~~~~~~~~~~~~

.-------------------.
| |
--|> Clk |
| _ |
--| R/W |
| |
--| Reset |
| |
--| Fuse |
| |
--| Vpp |
| |
| |
'-. .-'
| |
.-------------------.
| Out |-- serial output
'-------------------'

1.3 - PINOUT of the connector:
~~~~~~~~~~~~~~~~~~~~~~~


AFNOR CHIP
----------
Afnor Position ISO position
(in the left top corner) (in the middle left)

-------------+------------- -------------+-------------
| 8 | 4 | | 1 | 5 |
| | | | | |
+-------\ | /-------+ +-------\ | /-------+
| 7 +----+----+ 3 | | 2 +----+ + 6 |
| | | | | | | |
+--------| |--------+ +--------| |--------+
| 6 | | 2 | | 3 | | 7 |
| + +----+ | | +----+----+ |
+-------/ | \-------+ +-------/ | \-------+
| 5 | 1 | | 4 | 8 |
| | | | | |
-------------+------------- -------------+-------------

NB: only the position of the chip is ISO
standardized and not the pinout

PINOUT: 1 : Vcc = 5V 5 : Gnd
------ 2 : R/W 6 : Vpp = 21V
3 : Clock 7 : I/O
4 : Reset 8 : Fuse

1.4 - Main features:
~~~~~~~~~~~~~

- Synchronous protocol.
- N-MOS technology.
- 256x1 bit organisation.
- 96 written protected by a lock-out fuse.
- Low power 85mW in read mode.
- 21 V programming voltage.
- Access time: 500ns
- Operating range: -10 C +70 C
- Ten year data rentention.

1.5 - Time diagrams:
~~~~~~~~~~~~~

+21V _____________
+5V ____________________________________|
|_________________ Vpp
: :
+5V
___________________:_____________:_________________
Reset
0V ________________| : :
: : :
+5V ____ : ____ : ______:______
0V ___| |_______:_____| |________:______| :
|__________ Clock
: : : : : : : : :
+5V : : : : : :______:______: : _
0V ___:____:_______:_____:____:________| :
|______:__________ R/W
: : : : : : : : :
+5V : : :_____: :________: : : :__________
0V
XXXXXXXXXXXXXXXXX_____XXXXXX________XXXXX
XXXXXXXXXXXXXXXXX__________ Out
: : : : : :<-----><---->: :
: : : : : :10 to 10 to :
: : : : : :50 ms 50ms :
Reset Bit 1 Bit2 Bit 3
card reading reading Bit2 writing to 1 reading


1.6 - Memory Map for cards from France and Monaco:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Bytes Bits Binary Hexa

+-----------+-----+
1 1 --> 8 | | | ---> Builder code.
+-----------+-----+
2 9 --> 16 | 0000 0011 | $03 | ---> french telecard
+-----------+-----+
3 17 --> 24 | | |
+-----------+-----+
4 25 --> 32 | | |
+-----------+-----+
5 33 --> 40 | | |
+-----------+-----+
6 41 --> 48 | | |
+-----------+-----+
7 49 --> 56 | | |
+-----------+-----+
8 57 --> 64 | | |
+-----------+-----+
9 65 --> 72 | | |
+-----------+-----+
10 73 --> 80 | | |
+-----------+-----+
11 81 --> 88 | 0001 0000 | $10 |
+-----------+-----+
12 33 --> 40 | 0001 0011 | $13 | ---> 120 units card
| 0000 0110 | $06 | ---> 50 units card
| 0000 0101 | $05 | ---> 40 units card
+-----------+-----+
13-31 97 --> 248 | | | ---> The units area: each time a unit
| | | is used, then a bit is set to "1";
| | | Generaly the first ten units are
| | | fused in factory as test.
| | |
| | |
| | |
+-----------+-----+
32 249 --> 256 | 1111 1111 | $FF | ---> the card is empty
+-----------+-----+


1.7 - Memory Map for cards from Andora, Czech, Finland, Gabon, Ireland,

~~~~~~~~~~~~~~
Ireland, Mexico, Norway, Portugal,Sweden:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Bytes Bits Binary Hexa

+-----------+-----+
1 1 --> 8 | | |
+-----------+-----+
2 9 --> 16 | 1000 0011 | $83 | ---> telecard
+-----------+-----+-----------+-----+
3-4 17 --> 32 | 1000 0000 | $10 | 0001 0010 | $12 | ---> 10 units
card
| | | 0010 0100 | $24 | ---> 22 units card
| | | 0010 0111 | $27 | ---> 25 units card
| | | 0011 0010 | $32 | ---> 30 units card
| | | 0101 0010 | $52 | ---> 50 units card
| | | 0110 0010 | $62 | ---> 60 units card
| | | 1000 0010 | $82 | ---> 80 units card
| 0001 0001 | $11 | 0000 0010 | $02 | ---> 100 untis
card
| | | 0010 0010 | $22 | ---> 120 units card
| | | 0101 0010 | $52 | ---> 150 units card
+-----------+-----+-----------+-----+
5 33 --> 40 | | | ---> $00 Andora
+-----------+-----+ Czech
6 41 --> 48 | | | Finland
+-----------+-----+ Gabon
7 49 --> 56 | | | Norway
+-----------+-----+ Portugal
8 57 --> 64 | | | Sweden
+-----------+-----+
9 65 --> 72 | | |
+-----------+-----+
10 73 --> 80 | | |
+-----------+-----+ Czech, Andora, Gabon,
Portugal
11 81 --> 88 | | | ---> $11 Finland, Ireland, Norway,
Gabon
+-----------+-----+
12 89 --> 96 | 0001 1101 | $1D | ---> French Cin?carte [TBC]
| 0001 1110 | $1E | ---> Sweden
| 0010 0100 | $24 | ---> Mexico [TBC]
| 0011 0000 | $30 | ---> Norway
| 0011 0011 | $33 | ---> Andorra
| 0011 1100 | $3C | ---> Ireland
| 0100 0111 | $47 | ---> Portugal
| 0101 0101 | $55 | ---> Czech Republic / Yougoslavia
(?)
| 0101 1111 | $5F | ---> Gabon
| 0110 0101 | $65 | ---> Finland
+-----------+-----+
13-31 97 --> 248 | | | ---> The units area: each time a unit
| | | is used, then a bit is set to "1";
| | |
| | | Generaly the first two units are
| | | fused in factory as test.
| | |
| | |
+-----------+-----+
32 249 --> 256 | 0000 0000 | $00 |
+-----------+-----+

1.8 - Memory Map for cards from Spain:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Bytes Bits Binary Hexa

+-----------+-----+ 96
1 1 --> 8 | | | ---> Check Sum Byte = 216 - Sum b(i)
+-----------+-----+ i=9
2 9 --> 16 | 1000 0011 | $83 | ---> a telecard
+-----------+-----+
3 17 --> 24 | 1111 1111 | $FF | [TBC]
+-----------+-----+
4 25 --> 32 | 1111 1111 | $FF | [TBC]
+-----------+-----+
5 33 --> 40 | | | ---,
+-----------+-----+ |
6 41 --> 48 | | | ---+
+-----------+-----+ |---> Serial Number
7 49 --> 56 | | | ---+
+-----------+-----+ |
8 57 --> 64 | | | ---'
+-----------+-----+-----------+-----+
9-10 65 --> 80 | 0001 0100 | $14 | 1000 1010 | $8A | ---> 1000
pesetas
| 0010 0101 | $25 | 0000 0100 | $04 | ---> 2000 pesetas
| 0010 0101 | $25 | 0000 0110 | $06 | ---> 2100 pesetas
+-----------+-----+-----------+-----+
11 81 --> 88 | 0001 1110 | $1E |
+-----------+-----+
12 89 --> 96 | 0010 0010 | $22 | ---> Spain
+-----------+-----+
13 97 --> 104 | 1111 1111 | $FF | ---> the first ten units are
fused
| 11xx xxxx | $xx | in factory for testing.
| xxxx xxxx | $xx |
| xxxx xxxx | $xx | ---> Slow counter area
| xxxx xxxx | $xx |
+-----------+-----+
| xxxx xxxx | $xx |
| xxxx xxxx | $xx | ---> Fast counter area
32 249 --> 256 | xxxx xxxx | $xx |
+-----------+-----+

The slow counter area:
----------------------
- Increment: counts units by an increment of 5 pesetas
- size:
o [b107 ... b206] for 1000 pesetas cards
o [b127 ... b166] for 2000 pesetas cards
o [b107 ... b166] for 2100 pesetas cards

The Fast counter area:
----------------------
- Increment: counts units by an increment of
o 10 pesetas for the 1000 pesetas cards
o 20 pesetas for the 2000 pesetas cards
o 20 pesetas for the 2100 pesetas cards

- size:
o [b207 ... b256] for the 1000 pesetas cards
o [b167 ... b256] for the 2000 pesetas cards
o [b167 ... b256] for the 2100 pesetas cards

Exemple of an fast units area: (1000 pesetas cards)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00
0000 0000
0000 0000
0000 0000
0000 0000
0011 1110 ---> 14*10 pesetas are used
1000 1110

NB: Several units can be used, in this case only the last unit is
set as
used, like in the previous exemple, where some units are set
to 0 but
are nonetheless used.



II ) The cards from ODS, Giesecke & Devrient, ORGA Karten
systeme,

==============================================
===============
Uniqua, Gemplus, Schlumberger and Oldenbourg
Kartensysteme:

==============================================
=============

2.1 - Introduction:
~~~~~~~~~~~~

These cards are in fact 128 bit memory in NMOS technology,
and the
map of these cards are the following:

64 bit EPROM written protected (manufaturer area).
40 bit EEPROM (5x8 bits).
24 bits set to "1".

2.2 - Pinout:
~~~~~~

ISO 7816-2

-------------+-------------
| 1 | 5 | Pinout:
| | | -------
+-------\ | /-------+
| 2 +----+ + 6 | 1 : Vcc = 5V 5 : Gnd
| | | | 2 : Reset 6 : n.c.
+--------| |--------+ 3 : Clock 7 : I/O
| 3 | | 7 | 4 : n.c. 8 : n.c.
| +----+----+ |
+-------/ | \-------+ n.c. : not connected
| 4 | 8 |
| | |
-------------+-------------

2.3 - Main features:
~~~~~~~~~~~~~

- ISO 7816- 1/2 compatible.
- use a single 5V power supply.
- low power consuption.
- NMOS technology.

2.4 - Time Diagrams:
~~~~~~~~~~~~~

Reset:
------
The address counter is reset to 0 when the clock line CLK is raised while
the control line R is high. Note that the address counter can not be reset
when it is in the range 0 to 7.

__________________
_____|
|_____________________________________________ Reset
: :
: _____ : _____ _____ _____ _____
_____:_______| |____:_| |_____| |_____| |_____| |_
Clk
: : : : : : : : : : :
_____:_______:__________:_:_____:_____:_____:_____:_____:
_____:_____:_
_____:___n___|_____0____:_|_____1_____|_____2_____|_____3
_____|___4_:_ (Address)
: : : : : :
_____:
:_______:___________:___________:___________:_
_____XXXXXXXXXXXXXXXXXXXX_______|___________|_
__________|___________|_ Data
Bit n Bit 0 Bit 1 Bit2 Bit3

The address counter is incremented by 1 with each rising edge of the clock
signal Clk, for as long as the control line R remains low. The data held in
each addressed bit is output to I/O contact each time Clk falls. It is not
impossible to decrement the address counter, therefore to address an earlier
bit, the address counter must be reset then incremented to require
value.

Write:
------
All unwritten or erased bits in the address 64-104 may be unwritten to.
When a memory cell is unwritten to, it is set to 0. The addressed cell is
unwritten to by the following sequence.

1- R is raised while Clk is low, to disable address counter increment for one
clock pulse.

2- Clk is then raised for a minimum of 10ms to write to the address
bit.

When to write operation ends, and Clk falls, the address counter is unlocked,
and the content of the written cell, which is now 0, is output to I/O contact
if the operation is correct. The next Clk pulse will increment the address by one, then the
write sequence can be repeated to write the next bit.

_____ _____
_____________| |______________________________|
|_______________ Reset
: :
___ : _____ ___ : _____
____| |____:__________| |_________| |_____:__________|
|____ Clk
: : : : : : : : :
____:________:__________:_____:_________:___:_____:_____
_____:_____:_____
n | n+1 | n+2 | : n+3 | : (Address)
----'--------:----------'-----:---------'---:-----:----------'-----:-----
: : : : : : :
_________ _: : : ____________: ___: : :
_________XXX_XXXXXXXXXXXXXXXXXXX____________
XX___XXXXXXXXXXXXXXXXXXXXXXX I/O
n n+1 : : n+1 n+2 : :
: : : :
write write

WriteCarry:
-----------

A counter is erased by performing the WRITECARRY sequence on the stage of
the next highest weighing to that to be erased.

The writecarry sequence is as follows:

1 - Set the address counter to an unwritten bit in the next highest counter
stage to that to be erased.

2 - Increment is disabled on the following rising edge of R where Clk remains
low.

3 - Clk is then raised for a minimum of 10ms, while R is low, to write to the
next address bit.

4 - R is the raised again while Clk remains low to disable increment a second
time.

5 - Clk is the raised for a minimum of 1ms, while R is low, to write to the
addressed bit a second time, erasing the counter level immediately below that
the addressed bit.

_____ _____
______| |____________________|
|_________________________________ Rst
: :
: _______ : _______ ___
______:___________| |______:_____________| |______|
|______ Clk
: : : : : : : :
: : : : : : : :
<------------------------- address n ------------------------>:<--- n+1 -----
-
: : : : : : :
: : : : : : :
______: : :______: : :__________: _____
______XXXXXXXXXXXXXXXXXXXXX______XXXXXXXX
XXXXXXXXXXXXXXX__________XX_____ I/O
: : n : : n n+1
: : : :
Write Erase

2.5 - Memory Map:
~~~~~~~~~~

2.5.1 - Memory Map for 5 satge octal unit counter:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Bytes Bits Binary Hexa

+-----------+-----+
1 1 --> 8 | | $F4 | ---> Germany
| | $80 |
+-----------+-----+
2 9 --> 16 | 0010 1111 | $2F | ---> Germany
| 0110 1111 | $6F |
+ - - - - - + - - +
| 0011 0111 | $37 | ---> Netherland
+-----------+-----+
3 17 --> 24 | 1111 1111 | $FF |
+-----------+-----+
4 25 --> 32 | | |
5 33 --> 40 | | |
6 41 --> 48 | | | ---> Issuer area (written protected)
7 49 --> 56 | | |
8 57 --> 64 | | |
+-----------+-----+
9 65 --> 72 | | | ---> c4096 )
10 73 --> 80 | | | ---> c512 )
11 81 --> 88 | | | ---> c64 ) 5 stage octal counter
12 89 --> 96 | | | ---> c8 )
13 97 --> 104 | | | ---> c0 )
+-----------+-----+
14 105 --> 112 | 1111 1111 | $FF |
15 113 --> 120 | 1111 1111 | $FF | ---> area of bits set to "1"
16 120 --> 128 | 1111 1111 | $FF |
+-----------+-----+

2.5.2 - Memory Map for 4 satge octal unit counter:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Bytes Bits Binary Hexa

+-----------+-----+
1 1 --> 8 | | $94 | ---> Greece
| | $92 |
+-----------+-----+
2 9 --> 16 | 0011 1011 | $3B | ---> Greece
+-----------+-----+
3 17 --> 24 | 1111 1111 | $FF |
+-----------+-----+
4 25 --> 32 | | | ---> Issuer area (written protected)
5 33 --> 40 | | |
6 41 --> 48 | | |
7 49 --> 56 | | |
8 57 --> 64 | | |
+-----------+-----+
9 65 --> 72 | | | ---> c512 )
10 73 --> 80 | | | ---> c64 )
11 81 --> 88 | | | ---> c8 ) 4 stage octal counter
12 89 --> 96 | | | ---> c0 )
+-----------+-----+
13 97 --> 104 | 1111 1111 | $FF |
14 105 --> 112 | 1111 1111 | $FF |
15 113 --> 120 | 1111 1111 | $FF | ---> area of bits set to "1"
16 120 --> 128 | 1111 1111 | $FF |
+-----------+-----+

The Issuer area:
----------------

This issuer consists of 40 bits. The contents of the issuer area are
specified by the card issuer, and are fixed during the manufacturing process.
The contents of the issuer area will include data such as serial numbers,
dates, and distribution centers.

This area may only be read.

The Counter area:
-----------------

The counter area stores the card's units. Its initial value is specified by
the card issuer and set during manufacturing.

The counter area is divided into a 5 stage abacus counter, or 4 stage abacus
counter. The octal value of each stage is defined by the number of bits set to '1' and this stage vaue must
be weighted by the coeficient 8^n ( where n is among [4..0] or
[3..0]).

Exemple: For a 5 stage octal unit counter with 15818 units left.
--------

Byte9 Byte10 Byte11 Byte12 Byte13
--------------------------------------------------------------
00000111 - 00111111 - 01111111 - 00000001 - 00000011
--------------------------------------------------------------
(3)octal (6)octal (7)octal (1)octal (2)octal
--------------------------------------------------------------
Value = 3*8^4 + 6*8^3 + 7*8^2 + 1*8^1 + 2*8^0
--------------------------------------------------------------
TOTAL = 15818 Units


Note that you can only decrease the counter and it is not authorised to write
in the counter a value greater than the old value.

NB: In fact most of the card units don not represent telecom units, but money
units, for exmeple in german cards each telecom unit represent 30 pfennigs.

2.6 - Electrical features:
~~~~~~~~~~~~~~~~~~~~

Maximum ratings:
----------------

+--------+------+------+------+
| Symbol | Min | Max | Unit |
+----------------------+--------+------+------+------+
| Supply voltage | Vcc | -0.3 | 6 | V |
+----------------------+--------+------+------+------+
| Input voltage | Vss | -0.3 | 6 | V |
+----------------------+--------+------+------+------+
| Storage temperature | Tstg | -20 | +55 | C |
+----------------------+--------+------+------+------+
| Power dissipassion | Pd | - | 50 | mW |
+----------------------+--------+------+------+------+

DC caracteristics:
------------------
+--------+-----+-----+-----+------+
| Symbol | Min.| Typ.| Max.| Unit |
+---------------------------+--------+-----+-----+-----+------+
| Suplly current | Icc | - | - | 5 | mA |
+---------------------------+--------+-----+-----+-----+------+
| Input Voltage (low) | Vl | 0 | - | 0.8 | V |
+---------------------------+--------+-----+-----+-----+------+
| Input voltage (high) | Vh | 3.5 | - | Vcc | V |
+---------------------------+--------+-----+-----+-----+------+
| Input current R | Ih | - | - | 100 | uA |
+---------------------------+--------+-----+-----+-----+------+
| Input current Clk | Il | - | - | 100 | uA |
+---------------------------+--------+-----+-----+-----+------+
| Output current (Vol=0.5V) | Iol | - | - | 10 | uA |
+---------------------------+--------+-----+-----+-----+------+
| Output current (Voh=5V) | Ioh | - | - | 0.5 | mA |
+---------------------------+--------+-----+-----+-----+------+

AC caracteristics:
------------------ +--------+------+------+------+
| Symbol | Min. | Max. | Unit |
+----------------------+--------+------+------+------+
| Pulse duration | tr | 50 | - | us |
| R address reset | | | | |
+----------------------+--------+------+------+------+
| Pulse duration | ts | 10 | - | us |
| R write | | | | |
+----------------------+--------+------+------+------+
| High level Clk | th | 8 | - | us |
+----------------------+--------+------+------+------+
| Low level Clk | tl | 12 | - | us |
+----------------------+--------+------+------+------+
| Write window | Twrite | 10 | - | ms |
+----------------------+--------+------+------+------+
| Erase window | Terase | 10 | - | ms |
+----------------------+--------+------+------+------+
| | tv1 | 5 | - | us |
+----------------------+--------+------+------+------+
| | tv2 | 3.5 | - | us |
+----------------------+--------+------+------+------+
| | tv3 | 3.5 | - | us |
+----------------------+--------+------+------+------+
| | tv4 | 3.5 | - | us |
+----------------------+--------+------+------+------+
| | tv5 | 3.5 | - | us |
+----------------------+--------+------+------+------+
| | tv6 | 5 | - | us |
+----------------------+--------+------+------+------+
| | tv7 | 5 | - | us |
+----------------------+--------+------+------+------+
| | tv8 | 10 | - | us |
+----------------------+--------+------+------+------+


III) Schematics of Readers:
=======================

3.1 - Reader 1:
~~~~~~~~~

External 5V (Optional)

5V o------,
| / T2 PNP d13 r7 10
0V o--, | / BC 177 |\ | _____
| | ,-------o/ o--*------. E C .--| >+-[_____]--------,
__+__ | | | \ / |/ | |
\\\\\ | __|__ Batery | \ / |
| - 22.5V | --------- |
....... | | | _____ | _____ |
: | __+__ +--[_____]--*--[_____]--, |
D2 : | \\\\\ r6 150k r5 15k | |
4 o-------|---------------------------*------------------|-------------, |
: | | r3 220k / C | |
Ack : | | _____ |/ T1 - NPN | |
10 o------|--------. '--[_____]-*---| BC107 | |
: | | _____ | |\ | |
: ,-, ,-, +--[_____]-' \ E | |
: | |r2 | |r1 | r4 390k | | |
: | |220 | |22k __+__ __+__ | |
: |_| |_| \\\\\ \\\\\ | |
: | |\ | | | |
: *--| >+--|----------------*----------------------------------|--*
: | |/ | | ,-----|-----------------------------, | |
: | d1 | | | ,----------,----------, | | |
: | | | *---|-*(8) Fuse| Rst (4)*-|---' | |
: | | | | |----------|----------| | |
D0 : | | | ,-|---|-*(7) I/O | Clk (3)*-|---, | |
2 o-------|--------|----------' | | |----------|----------| | | |
: | | | '---|-*(6) Vpp | R/W (2)*-|---|----' |
Busy : | | | |----------|----------| | |
11 o------|--------|--------------' ,---|-*(5) Gnd | 5V (1)* | | |
: | | | '----------'--------|-' | |
D1 : | | __+__ Chip connector | | |
3 o-------|--------|--------, \\\\\ | | |
: | | '-------------------------------|-----' |
Str : | |\ | | | |
1 o-------*--| >+--*----*----*----*----*--------------------' |
: d2|/ | |d3 |d4 |d5 |d6 |d7 |
: -+- -+- -+- -+- -+- |
: /_\ /_\ /_\ /_\ /_\ |
D3 : | | | | | |\ | d8 |
5 o----------------*----|----|----|----|---| >+-------*-------------------'
: | | | | |/ | |
: | | | | |
D4 : | | | | |\ | d9 |
6 o---------------------*----|----|----|---| >+-------*
: | | | |/ | |
: | | | |
D5 : | | | |\ | d10 |
7 o--------------------------*----|----|---| >+-------*
: | | |/ | |
: | | |
D6 : | | |\ | d11 |
8 o-------------------------------*----|---| >+-------*
: | |/ | |
: | |
D7 : | |\ | d12 |
9 o------------------------------------*---| >+-------'
: |/ |
:
:
25 o------.
: |
.......: | d1 to d13: 1N4148
__+__
\\\\\

Centronic port

3.2 - Reader 2:
~~~~~~~~~

Zener 3.3V
2x1N4001 ________ / 150ohms
|\ | |\ | | | / _____ | /| (6)
o----, ,--+ >+--*--+ >+--*---+ 7824 +----*--o/ o-|_____|-+< +-*--
--o Vpp
| | |/ | | |/ | | |________| | | \| |
)||( 220uF | 220uF | | ===== 0.22uF _+_
220V )||( 25V | + 40V | + | | / \ 1N4148
)||( ===== ===== __+__ __+__ '-+-'
~ )||( | - | - \\\\\ \\\\\ ,+,
| | ___ | | | | 12ohms
o----' '--o o-* __+__ | |
card | \\\\\ ________ '+' 12ohms
present | |\ | | | | _____ (1)
'--+ >+------+ 7805 +------*-------------------*--|_____|-o
Vcc
|/ | |________| | |
1N4001 | _+_ |
| \ / ---> ,+,
__+__ -+- ---> | |
\\\\\ | | | 4.7kohms
,+, '+'
| | | (7)
| | 680ohms *----------o I/O
'+' |
| Busy (11) o
| (4)
__+__ D0 (2) o-----*----o Raz
\\\\\ |
4.7nF =====
|
__+__
\\\\\ (3)
D1 (3) o----------o Clk

(2)
D2 (4) o----------o W

Gnd (25) o
| fuse (8)
*--~~~~~---o Fus
__+__
\\\\\

IV) The program:
===========

The following program will enable you to read telecards on you PC if you
build the reader 1.

****************************************************
* T E L E C A R D . PAS
****************************************************
* This program dump the memory of the 128 bit or 256 bit type telecards.
****************************************************
*
* Written by Stephane BAUSSON (1993, 1994)
*
*
* Email: [email protected]
*
* Snail Mail Address: 4, Rue de Grand
* F-88630 CHERMISEY
* France
*------------------------------------------------------------------------
* Version 2.01 (Last revised: 08-07-1994)
****************************************************)

USES crt,dos;

CONST port_address=$378; (* Select Printer PORT 1 *)

TYPE string8=string[8];
string2=string[2];

VAR reg : registers;
i,j : integer;
Data : array[1..32] of byte;
Bin : string;
car : char;
byte_number : integer;
displaying : char;
saving : boolean;
SavingFile : TEXT;
FileName : string[30];

{-----------------------------------------------------------------------------}
{ PROCEDURE Send(b:byte); }
{ }
{ - Send a byte on the selected printer port. }
{-----------------------------------------------------------------------------}

PROCEDURE Send(b:byte);

BEGIN port[port_address]:=b;
END;

{-----------------------------------------------------------------------------}
{ FUNCTION Get:byte; }
{ }
{ - Get a byte from the status register of the selected printer
port. }
{-----------------------------------------------------------------------------}

FUNCTION Get:byte;

BEGIN get:=port[port_address+1];
END;

{-----------------------------------------------------------------------------}
{ FUNCTION
dec2hexa_one(decimal_value):hexa_character_representation;
}
{ }
{ - convert a 4 bit long decimal number to hexadecimal.
}
{-----------------------------------------------------------------------------}

FUNCTION dec2hexa(value:byte):char;

BEGIN case value of
0..9 : dec2hexa:=chr(value+$30);
10..15 : dec2hexa:=chr(value+$37);
END;
END;

{-----------------------------------------------------------------------------}
{ FUNCTION d2h(decimal_byte):string2;
}
{ }
{ - convert a decimal byte to its hexadecimal representation.
}
{-----------------------------------------------------------------------------}

FUNCTION d2h(value:byte):string2;

BEGIN d2h:=dec2hexa(value div $10) + dec2hexa(value and
$0F);
END;

{-----------------------------------------------------------------------------}
{ FUNCTION Binary(byte):string8; }
{ }
{ - Convert a byte to its binary representation. }
{-----------------------------------------------------------------------------}

FUNCTION Binary( b : byte):string8;

VAR weigth : byte;
s : string8;

BEGIN weigth:=$80;
s:='';
while (weigth > 0) do
BEGIN if ((b and weigth) = weigth) then s:=s+'1'
else s:=s+'0';
weigth:=weigth div $02;
END;
Binary:=s;
END;

{-----------------------------------------------------------------------------}

FUNCTION Units:byte;

VAR u, i, j : integer;
s : string8;

BEGIN u:=0;
i:=13;
while (Data[i] = $FF) do
BEGIN u:=u+8;
i:=i+1;
END;

s:=Binary(Data[i]);
for j:=1 to 8 do if s[j]='1' then inc(u);
units:=u;
END;

{-----------------------------------------------------------------------------}

FUNCTION BitCount( Data : integer ):integer;

VAR i : integer;

BEGIN i:=0;
while ((Data and $01)=$01) do
BEGIN Data:=Data div 2;
inc(i);
END;
BitCount:=i;
END;

{-----------------------------------------------------------------------------}

FUNCTION Five_Stage_Octal_Count:LongInt;

BEGIN Five_Stage_Octal_Count:=

4096*BitCount(Data[9])+512*BitCount(Data[10])+64*BitCount(
Data[11])
+8*BitCount(Data[12])+BitCount(Data[13]);
END;

{-----------------------------------------------------------------------------}

FUNCTION Four_Stage_Octal_Count:LongInt;

BEGIN Four_Stage_Octal_Count:=

512*BitCount(Data[9])+64*BitCount(Data[10])+8*BitCount(Data
[11])
+BitCount(Data[12]);
END;

{-----------------------------------------------------------------------------}

FUNCTION Count_Bits_To_Zero( Data:byte ):byte;

BEGIN
END;

{-----------------------------------------------------------------------------}

FUNCTION Spanish_Units( units:word ) : word;

VAR init : word;
long : word;
step : word;
value: word;

BEGIN case units of
$148A: BEGIN init:=107; long:=100; step:=10;
END;
$2504: BEGIN init:=127; long:=40; step:=20;
END;
$2506: BEGIN init:=107; long:=60; step:=20;
END;
END;

value:=0;
i:=init;

while (Bin[i]='0') and (i < init+long) do
BEGIN inc(Value);
value:=value+5;
END;

i:=init+long;

while (Bin[i]='0') and (i < 256) do
BEGIN inc(Value);
value:=value+step;
END;

Spanish_Units:=value;
END;

{-----------------------------------------------------------------------------}

PROCEDURE Card_Type;

VAR s : string;
u : word;

BEGIN case Data[2] of

(*------------------*)
(* french telecards *)
(*------------------*)
$03: BEGIN write('Telecard / France / ');
case Data[12] of
$13: write('120 Units / ',130-units,' Units left');
$06: write('50 Units / ',60-units,' Units left');
$05: write('40 Units / ',50-units,' Units left');
END;
END;

(*------------------*)
(* German telecards *)
(*------------------*)
$2F, $6F:
write('Telecard / Germany / ',Five_Stage_Octal_Count,
' Pfennigs left');

(*-----------------*)
(* Dutch telecards *)
(*-----------------*)
$37:write('Telecard / Neitherland /
',Five_Stage_Octal_Count,' Units left');

(*-----------------*)
(* Greek telecards *)
(*-----------------*)
$3B:write('Telecard / Greece / ', Four_Stage_Octal_Count div
2,
' Units left');

$83:BEGIN write('Telecard');
case Data[12] of
$1E: write(' / Sweden');
$22: write(' / Spain');
$30: write(' / Norway');
$33: write(' / Andorra');
$3C: write(' / Ireland');
$47: write(' / Portugal');
$55: write(' / Czech Republic');
$5F: write(' / Gabon');
$65: write(' / Finland');
END;

case Data[12] of
$1E,$30,$33,$3C,$47,$55,$5F,$65:
BEGIN case ((Data[3] and $0F)*$100+Data[4]) of
$012: write (' 10 Units / ',12-units,' Units left');
$024: write (' 22 Units / ',24-units,' Units left');
$027: write (' 25 Units / ',27-units,' Units left');
$032: write (' 30 Units / ',32-units,' Units left');
$052: write (' 50 Units / ',52-units,' Units
left');
$067: write (' 65 Units / ',67-units,' Units
left');
$070: write (' 70 Units / ',72-units,' Units
left');
$102: write (' 100 Units / ',102-units,' Units
left');
$152: write (' 150 Units / ',152-units,' Units
left');
END;
END;

(*-------------------*)
(* Spanish telecards *)
(*-------------------*)
$22:
BEGIN u:=Data[9]*$100+Data[10];
case u of
$148A: write(' 1000 pesetas');
$2504: write(' 2000 pesetas');
$2506: write(' 2100 pesetas');
END;
write(' / ',Spanish_Units(units),' units left');
write(' / #', d2h(Data[5]), d2h(Data[6]),
'-', d2h(Data[7]), d2h(Data[8]));
END;

END; (* case Data[12] *)
END; (* $83 *)
END; (* case Data[2] *)
END;

{-----------------------------------------------------------------------------}

PROCEDURE waiting;

BEGIN send($00);
write('Enter a card in the reader and press a key ...');
repeat until keypressed;
gotoxy(1, wherey);
clreol;
END;

{-----------------------------------------------------------------------------}

PROCEDURE Full_Displaying;

BEGIN writeln('Memory dump:');
for i:=1 to 80 do write('-');
for i:=1 to (byte_number div 6 + 1) do
BEGIN for j:=1 to 6 do
if j+6*(i-1) <= byte_number then
write(binary(Data[j+6*(i-1)]):9)
else write(' ');
write(' ');
for j:=1 to 6 do
if j+6*(i-1) <= byte_number then write(d2h(Data[j+6*(i-
1)]),' ');
writeln;
END;
for i:=1 to 80 do write('-');
Card_Type;
writeln;

if saving then
BEGIN writeln(SavingFile,'Memory dump:');
for i:=1 to 80 do write(SavingFile,'-');
for i:=1 to (byte_number div 6 + 1) do
BEGIN for j:=1 to 6 do
if j+6*(i-1) <= byte_number then
write(SavingFile,binary(Data[j+6*(i-1)]):9)
else write(SavingFile,' ');
write(SavingFile,' ');
for j:=1 to 6 do
if j+6*(i-1) <= byte_number then
write(SavingFile,d2h(Data[j+6*(i-1)]),' ');
writeln(SavingFile);
END;
for i:=1 to 80 do write(SavingFile,'-');
writeln(SavingFile);
END;
END;

{-----------------------------------------------------------------------------}

PROCEDURE Short_Displaying;

VAR j : integer;

BEGIN for j:=1 to byte_number do
BEGIN write(d2h(Data[j]),' ');
if saving then write(SavingFile,d2h(Data[j]),' ');
END;
writeln;
if saving then writeln(SavingFile);
END;

{-----------------------------------------------------------------------------}

PROCEDURE Reading;

VAR i, j : integer;
Value : byte;

BEGIN (*----------------------------------------*)
(* R/W is high for 256 bit cards: d2=1 *)
(* Activate Reset for 256 bit cards: d0=0 *)
(* Activate Reset 128 bit cards: d2=1 *)
(* Clock is high: d1=1 *)
(*----------------------------------------*)
Send($FE);
(*-------------------------------------------*)
(* R/W is low for 256 bit cards: d2=0 *)
(* Desactivate Reset for 256 bit cards: d0=0 *)
(* Desactivate Reset for 128 bit cards: d2=0 *)
(* Clock is low: d1=0 *)
(*-------------------------------------------*)
Send($F9);

for i:=1 to byte_number do
BEGIN Value:=0;
for j:=1 to 8 do
BEGIN Value:=Value*$02 + ((get and $08) div $08);

send($FB); (* Raise Clk to high level *)
send($F9); (* Fall Clk to low level *)

{delay(1);} (* Set a delay if it doesn't work *)

END;
Data[i]:=Value;
END;

Bin:='';
for i:=1 to byte_number do Bin:=Bin+Binary(Data[i]);

case displaying of
'F':Full_Displaying;
'S':Short_Displaying;
END;
END;

{-----------------------------------------------------------------------------}

PROCEDURE writting;

VAR i,n:integer;
car:char;

BEGIN write('Which bit do you want to set to "1" : ');
readln(n);

waiting;
car:=readkey;

send($FA);
send($F8);
for i:=1 to n do
BEGIN send($F9);
if i=n then
BEGIN send($FD);
delay(20);
send($FF);
delay(20);
END;
send($FB);
END;
reading;
END;

{-----------------------------------------------------------------------------}

PROCEDURE initialize;

VAR i : integer;

BEGIN byte_number:=32;
displaying:='F';
saving:=false;
clrscr;
writeln(' 1 - to dump a 256 bits card');
writeln(' 2 - to dump a 128 bits card');
writeln(' F - to display in full format');
window(41,1,80,25);
writeln(' S - to display in short format');
writeln(' F2 - to save in a file');
writeln(' Q - to exit the program');
window(1,4,80,25);
for i:=1 to 80 do write('=');
window(1,5,80,25);
END;

{==============================================
===============================}

BEGIN initialize;
repeat waiting;
car:=upcase(readkey);
case car of
'W':writting;
'Q':;
'1':byte_number:=32;
'2':byte_number:=16;
'F','S':displaying:=car;
#00: BEGIN car:=readkey;
if car=#60 then
BEGIN if saving then close(SavingFile);
saving:=true;
write('Enter the saving filename: ');
readln(FileName);
assign(SavingFile,FileName);
rewrite(SavingFile);
END;
END;
else reading;
END;
until car='Q';
if saving then close(SavingFIle);
END.
--------------- cut here (end)
 
To the best of our knowledge, the text on this page may be freely reproduced and distributed.
If you have any questions about this, please check out our Copyright Policy.

 

totse.com certificate signatures
 
 
About | Advertise | Bad Ideas | Community | Contact Us | Copyright Policy | Drugs | Ego | Erotica
FAQ | Fringe | Link to totse.com | Search | Society | Submissions | Technology
Hot Topics
DO NOT go to six flags new england!
Going to France and Belgium.
Traveling Job?
Being A Bum In Flordia
Staying in hostels
Best in-flight entertainment system on an airline?
Moving to England
New York
 
Sponsored Links
 
Ads presented by the
AdBrite Ad Network

 

TSHIRT HELL T-SHIRTS