Title : PC to VideoCrypt and/or Smart Card interface via RS232 port.

The following interface has been built and used succesfully. It is loosely
based on Markus Kuhn's ADAPTER.TXT and can be used in three modes:

  * PC listens to traffic between VideoCrypt decoder and Smart Card.
  * PC pretends to be the Smart Card and talks to the VideoCrypt decoder.
  * PC pretends to be a VideoCrypt decoder and talks to the Smart Card.
                    3  5  8
       VCC oÄÂÄÄÄÄÄÄÂÄÄÂÄÄ¿
             ³    ÚÄÁÄÄÁÄÄÁÄ¿2
        100 ÍØÍ 1Ä´ EXO-3C  ÃÄÄo CLK output
         nF  ³    ÀÄÂÄÄÂÄÄÂÄÙ
       GND oÄÁÄÄÄÄÄÄÁÄÄÁÄÄÙ
                   4  6  7

Qty Part     Package  Description
1x  EXO-3C   DIL 8    Programmable Oscillator 14.31818Mhz max frequency

CIRCUIT DESCRIPTION

The interface is designed to be connected to a PC with a 9 pin or 25 pin
RS232 port. 

The PC's RS232 port operates with signals that swing from +12V to -12V. The
smart card however, operates with TTL signals that swing between +5V and 0V.
An RS232 -12V level corresponds to a TTL high (+5V) and a RS232 +12V level
corresponds to a TTL low (0V).

Due to this incompatibility, a signal level translator such as the MAX232
must be used. The MAX232 is powered from a single +5V supply and generates
internally the +/-12V voltages necessary for the RS232 communication.
The MAX232 needs external components to achieve this.

The DCD line is used to monitor the state of the RST line on the smart card.
This allows us to detect when a reset takes place.

The RXD line is used to receive data from the smart card.

All TTL signals from the MAX232 go to SC1 which is a smart card connector
accepting cards with contact locations that conform to the ISO7816-2 standard,
section 4, fig 2.

The final part of the circuit is a oscillator. This is only needed
if you intend to have the PC exchange data with a smart card. At all other
times the oscillator must be disconected. In the prototype the oscillator was
built on the board and a jumper is used to connect or diconect the oscillator
output to the card's CLK pin.

There are many options for building oscillators. Some people use discrete
components.

This Osc is a programmable frequency divider. This is a DIL 8 pin chip with
a built in crystal oscillator. The one in this project has a base frequency of
14.31818Mhz. Three pins on the chip allow a divisor between 2^1 to 2^8 to
be selected allowing frequencies between 7.15909Mhz and 55.93khz to be
produced. A separate output, provides the undivided base frequency. In this
project a divisor of 2^2=4 was selected effectively providing an output
frequency of 3.579545Mhz.

Oscillators are really noisy devices. They produce a lot of noise on the
power line. Therefore, a 0.1 uF capacitor _must_ be fitted as close to the
supply lines of the oscillator as possible. This not only eliminates the
noise on the supply lines but improves the sqareness of the generated
waveform.

Total current drawn at 5V with oscillator active is 7.6mA.

WARNING: Before attempting to connect the interface to any decoder, use a high
impedance DMM to measure the AC voltage difference between the interface GND
and the decoder's GND. If the difference is not close to 0VAC, earth the
decoder's GND before connecting the interface. Use at your own risk. If you
damage something you have no one to blame but yourself for stuffing with it
in the first place. Take care.

Regards

paul

