Gemplus GPR400 User manual

Version 1.3
GPR400
Reference Manual

At press time, this guide was as thorough and correct as possible, the information
contained herein may however have been updated after this date.
GEMPLUS reserves the right to change the functions and specifications of its
products at any time without prior notice.
This document was prepared by GEMPLUS for both its clients and for its own internal
use. The information contained herein is the sole property of GEMPLUS and shall not
under any circumstances be reproduced without prior consent of the company.
© Copyright GEMPLUS, 1997.
Smartcards and Smartcard Readers are patent protected by INNOVATRON
and produced by GEMPLUS under license.
Patented by Bull CP8 -Patented by Innovatron.
Printed in France.
GEMPLUS, B.P. 100, 13881 GEMENOS CEDEX, FRANCE.
Tel: +33 (0)4.42.36.50.00 Fax: +33 (0)4.42.36.50.90
Document Reference : DPD01597A30

GEMPLUS i
ABOUT THIS GUIDE
This manual describes the GEMPLUS GPR400 Compact Smartcard
Reader/Writer.
Audience
This manual assumes that you are familiar with Smartcards and Smartcard
reader technology.
How to Use This Manual
The following paragraphs tell you where to find information when you need
it. Read this section in order to use this guide to its full potential.
Preface Read the Preface for a general description of the GPR400 and of its
environment.
GPR400 Hardware
Read the “GPR400 Hardware” section for a description of the hardware and
its connections.
Sending Commands to a Smartcard
This section describes how to send commands to a Smartcard via the
GPR400. It includes the following information:
•command format,
•a list of Smartcard commands and other commands.

GEMPLUS ii
TABLE OF CONTENTS
ABOUT THIS GUIDE i
Audience......................................................................................i
How to Use This Manual.................................................................i
PREFACE 1
THE GPR400 HARDWARE 3
The PCMCIA Connector ................................................................3
GPR400 Architecture Overview.......................................................3
The 2K byte Memory.....................................................................4
PCCard Configuration....................................................................5
SENDING COMMANDS TO THE READER 6
Sending Commands to the GPR400...............................................6
Command and Response Format ...................................................8
Description of the TLV Field....................................................8
Chaining TLV fields ................................................................9
GPR400 Commands .....................................................................9
Select Card...........................................................................9
Open Session......................................................................11
Close Session.....................................................................11
APDU Exchange..................................................................12
Activate Driver......................................................................13
Reset GPR..........................................................................14
Power Down GPR................................................................14
Load Memory ......................................................................15
Read Memory......................................................................16

TABLE OF CONTENTS
GEMPLUS iii
Exec Memory......................................................................17
Status GPR.........................................................................17
APPENDIX A -OPERATING SPECIFICATIONS 19
Maximum Operating Values.........................................................19
Standard Operating Conditions.....................................................20
AC Test Conditions.....................................................................21
AC Characteristics...............................................................21
APPENDIX B -PIN-OUT DESCRIPTION 22
APPENDIX C -SAMPLE GPR400 SCENARIOS 25
Scenario 1...........................................................................25
Scenario 2...........................................................................25
Scenario 3...........................................................................27
APPENDIX D -STATUS CODES 30

GEMPLUS 1
PREFACE
The GPR400 (GEMPLUS Pocket Reader 400) is a Smartcard reader/writer
that has approximately the same dimensions as a Smartcard, and that fits
into a standard PCMCIA slot. When fitted into the PCMCIA slot, the
GPR400 leaves enough space for a Smartcard also to be inserted into the
PCMCIA slot beneath it, with its edges touching the Smartcard’s module
as shown in Figure 1below. It therefore is an electrical adapter that is
compliant with the ISO 7816-3 Smartcard standard for PCMCIA products.
Smart Card
PCMCIA slot
Smartcard
Smartcard
Smartcard
Compact Smartcard Reader Writer
Fig 1: GPR400, PCMCIA Slot, and Smartcard Configuration
When the reader is connected to the PCMCIA interface, it is seen as an
I/O PC Card (type II) as defined by PCMCIA standard releases 2.0 and
above.
The GPR400 has 128 Kbytes of optional flash memory and 2 Kbytes of
RAM. The flash memory (if present) is used by the embedded
microcontroller with a 16 Kbyte partition and cannot be accessed directly
by the PCMCIA interface. It can be used for:
•Smartcard application executable files,
•data files, such as Smartcard blacklists or information files,
•other executable files, such as the extended memory for a
microcontroller.

PREFACE
GEMPLUS 2
The RAM manages the PCMCIA interface as follows :
•32 bytes are used for I/O data exchange,
•2016 bytes are used as the Attribute Memory (defined by the
PCMCIA Standard 2.1 or by the PC Card Standard) and can
also be used as extended executable memory for the
microcontroller.

GEMPLUS 3
THE GPR400 HARDWARE
The GPR400 Smartcard interface complies with ISO 7816-1,-2, and -3
standards and is compatible with embossed Smartcards. The GPR400 is
connected to a portable PC using a PCMCIA slot (socket).
The PCMCIA Connector
The GPR400 is compatible with all PCMCIA sockets that accept type II PC
Cards (5.0 mm in thickness). The GPR400 includes a standard 68 pin
connector.
The Smartcard module is compliant with the ISO 7816 -2 standard.
GPR400 Architecture Overview
The GPR400 is based on a microcontroller. It communicates with the
PCMCIA bus using a specific component (ASIC) containing 2 Kbytes of
RAM.
The flash memory (128 Kbytes) is mapped onto the embedded
microcontroller. Please note this memory is optional in this release.
The GPR400 has an 8-bit data I/O structure.
The GPR400's power supply is provided by the PCMCIA interface
(Vcc=5V).
Flash
Microcontroller
Smart
Card
Specific
Component PCMCIA
Fig 2: GPR400 Architecture

THE GPR400 HARDWARE
GEMPLUS 4
The 2K byte Memory
The GPR400 has 2K bytes of RAM included in the specific component.
These 2K bytes are mapped as follows:
I/O BUFFER
I/O Start Address
Attribute MEMORY
External RAM Space
and
32 Bytes
2016 Bytes
Smartcard registers
Figure 3. GPR400 2k Bytes RAM Structure
The first 2016 bytes are used to store the Card Information Structure
(C.I.S.), the specific PCMCIA defined registers for I/O PC Card
(Configuration Option Register), the registers for the Smartcard interface
and some external RAM data which are used by the embedded
microprocessor for external data space or executable programs (application
programs or Smartcard drivers). The C.I.S. is downloaded by the internal
microcontroller. The external RAM data can be loaded by the embedded
microcontroller or by the PCMCIA interface (Attribute Memory space
access).
The 32-byte I/O buffer is used to transmit application commands to the
microcontroller handling interface with the smart card.

THE GPR400 HARDWARE
GEMPLUS 5
PCCard Configuration
When inserted into the computer, the GPR400 must be configured by the
host. To accomplish this, the host must first read the C.I.S. starting at
address 000h in the Attribute Memory. Then the GPR400 can be configured
using the Configuration Option Register (address FA0h) for an I/O base
address : 0300h, 0320h, 0340h, 0200h, 220h, 0240h or any space 32-byte
long memory space.
Configuration Option Register structure (see also PCCard Standard):
bit 7: set to 1, this bit initializes the GPR400 (minimum pulse of 5
µs)
bit 6-5 : reserved (reset to 0)
bit 4-0 : these bits are defined by the I/O base address as
described in the following table:
Configuration Option
register value I/O address
18 300h-31Fh
19 320h-33Fh
1A 340h-35Fh
10 200h-21Fh
11 220h-23Fh
12 240h-25Fh
01 all 32 bytes
boundary address
The register value 01 configures the GPR400 for all I/O addresses; the
INPACK signal is then systematically transmitted (see the PCCard
Standard).

GEMPLUS 6
SENDING COMMANDS TO THE READER
You can send the same commands to a Smartcard from the GPR400 as
those from any other reader. The command parameters will vary according
to the Smartcard, and they are listed in this section. For details regarding
available commands for each Smartcard, read the appropriate
documentation.
When you send a command to a Smartcard, you send it from the host to
the GPR400 I/O buffer. The microcontroller verifies that the command
format is correct; it then passes the command on to the appropriate
Smartcard.
You transmit commands to the GPR400 in a Type Length Variable (TLV)
format.
Note: When you develop applications for portable PCs that run on
batteries, bear in mind the following recommendation to limit battery
power consumption:
Power Off the Smartcard when you have finished accessing it, and
power down the GPR. This will switch the GPR400 into Power Down
mode.
Sending Commands to the GPR400
This section describes, in full detail, how to send Smartcard commands to
the GPR400. You send commands to the GPR400 through the 32-byte I/O
buffer. The first 2 bytes are specific registers and the other 30 bytes
(address 02h to 1Fh ) are used to store the TLV command. Four other
specific registers are located at the end of the Attribute Memory. The
following is a description of the 6 specific registers:
General Setup Register
Read only access: Address FB8h in the Attribute Memory
bit 4:= 0: Attribute Memory and I/O buffer locked
= 1: Attribute Memory and I/O buffer accessible

SENDING COMMANDS TO THE READER
GEMPLUS 7
other bits: Internal use.
Smartcard Register 1
Read only access: Address FBAh in the Attribute Memory.
bit 4: = 1: Smartcard was pulled-out
= 0: Smartcard is in the reader
bit 7: = 1: Smartcard inserted
= 0: no Smartcard inserted
other bits : internal use
Smartcard Register 2
Read only access: internal use : Address FBCh in the Attribute Memory
Clock and Control Register
Read only access: internal use : Address FBEh in the Attribute Memory
Handshake Register
Handshake register (read and write): address 00h in the I/O buffer.
bit 0 : Master Reset : A “RESET GPR” sets this bit to a minimum
time of 5 microseconds and waits for 20 milliseconds. This
command is the first action to perform after a “POWER
DOWN GPR”: it reactivates the embedded microprocessor.
Note that the GPR400 is automatically reactivated when
inserted into the PCMCIA socket.
bit 1 : INTR : GPR400 interrupt request: After sending the GPR400
command in the I/O buffer, the host must set this bit to 1 in
order to launch the execution phase. This bit will be reset by
the GPR400 after the execution of the command.
bit 2 :BUSY/IREQ : this bit is an image of the PCMCIA pin IREQ
(Interrupt Request). The GPR400 sets this bit to 1 after
command execution, forcing the IREQ pin to 0. The host can
receive the command response and then reset this bit to 0.
bits 3 to 7 : for PRG control (see Using PRG section)

SENDING COMMANDS TO THE READER
GEMPLUS 8
PRG Data register
The PRG Data register (refer to the “Using the PRG” section) is located at
address 01h in the I/O buffer.
Command and Response Format
The GPR400 command and response are structured in the TLV format.
This is as follows:
Type, Length, Variable
Description of the TLV Field
Type T
This value specifies the command on one byte. The command function is
one of the following:
•Select Card
•Open Session
•Close Session
•APDU Exchange
•Activate Driver
•Power Down GPR
•Load Memory
•Read Memory
•Exec Memory
•IFD Status
The response to a command is in the same location. The Type value is
equal to the command type value plus 02h (bit 1 set to 1).
Length L
This specifies the length, in bytes, of the V field, and must be a value from
1 to 28. The length field is coded on one byte.

SENDING COMMANDS TO THE READER
GEMPLUS 9
Variable V
This field must be the same length as that specified in L. The command
itself will be entered in this field (see the list of commands later in this
section).
Chaining TLV fields
The maximum length of a standard TLV field is 30 bytes (length of the I/O
buffer). To transmit larger commands, the host can chain TLV fields. The V
variable is then divided into V1, V2, ... Vn and transported in the TLiVi
chaining field noted Tc ( 'c' for chaining ).
T, L, V <=> (Tc1,L1,V1) + (Tc2,L2,V2) +.. + (Tn,Ln,Vn)
Tc1 : first block (index 1) of a chaining field (index c)
Tn : Block n of the last chaining field (index c is not present)
L = L1 + L2 +.. + Ln
The index “c” corresponds to the value of bit 2 of type T with :
bit 2 = 1 : chaining field.
bit 2 = 0 : standard field or last field.
The maximum chaining field Length is : V1 + V2 + .. + Vn = 256 bytes
(this corresponds to a 256-byte buffer for data exchange with a Smartcard).
GPR400 Commands
Select Card
This command initializes the reader for the Smartcard protocol used in the
application. Note that by default the Smartcard interface is configured for
ISO T = 0 protocol, with the clock equal to 3.68 MHz. The T=1 protocol is
automatically set if the GPR400 recognizes the T=1 Smartcard during an
“OPEN SESSION” command.

SENDING COMMANDS TO THE READER
GEMPLUS 10
Command Format
T = 50h
L = 01
V = b7...b0
where:
b1 .b0 = 00: Downloaded Smartcard driver 0
01: RFU (Reserved for Future Use)
10: Driver ISO 7816-3
11: RFU
b4 = 0: Smartcard clock = 3.68 MHz
1: Smartcard clock = 7.36 MHz
b7, b5, b3, b2 ::RFU
Answer Format
Type Ta = Tc + 02h (52h)
Length L = 01
Variable V = Reader Status Code

SENDING COMMANDS TO THE READER
GEMPLUS 11
Open Session
This command powers the Smartcard on. The power on sequence is fully
compatible with ISO 7816-3 standards and determines whether the T=0 or
T=1 protocol will be used.
This command powers a Smartcard on and sends the Answer To Reset
(ATR) to the terminal. If the Smartcard is already powered on, then the
command merely returns the ATR (this function then permits either a cold
or a warm reset ).
Command Format
T = 20h
L = 00
Answer Format
Type Ta = Tc + 02h (22h)
Length L = Length (SmartCard Answer to reset) +1
Variable V = Reader Status Code (1 byte), Answer To Reset
Close Session
This command powers off a Smartcard in compliance with ISO 7816
standards.
Command Format
T = 10h
L = 00
Answer Format
Type Ta = Tc + 02h (12h)
Length L = 01
Variable V = Reader Status Code

SENDING COMMANDS TO THE READER
GEMPLUS 12
APDU Exchange
This command sends a request to a Smartcard (T=0 or T=1 or use of
downloaded drivers).
In this mode, the GPR400 relays the Transport Protocol Data Unit (TPDU)
command to the Smartcard, and then returns the TPDU response from the
Smartcard to the application.
The T=1 protocol management implemented by the GPR400 offers a
transparent mode mechanism. The other T=1 mechanisms, such as
chaining, retransmission, and resynchronization must be handled by the
external application.
The Exchange Data buffer for ISO Smartcards has a length of 256 bytes.
Command Format
T = 30h
L=Length of V field
V = Vex
where Vex = DIR, Vinf for T=0 protocol
ISO In command : DIR=00
Vinf = CLA, INS, P1, P2, Lin, Data IN
ISO Out command : DIR=01
Vinf = CLA, INS, P1, P2, Lout
Vex = Nad, Pcb, Le, Vinf, E for T=1 protocol ( TPDU format )
Vinf = CLA, INS, P1, P2, Lin, Data, Lout
Answer Format
Type Ta = Tc + 02h
Length L = Length of V field
Variable V = Reader Status Code (1 byte) , Vans
where : Vans = Data Out for T=0 protocol.
Vans = Nad, Pcb, Le, Data, E (Data received from
the Smartcard in a TPDU format T=1)

SENDING COMMANDS TO THE READER
GEMPLUS 13
Activate Driver
This command validates a downloaded IC driver or a specific command
(subroutine) for the GPR400. The data corresponding to this driver or this
specific command must first be downloaded using the “LOAD MEMORY”
command. The downloaded IC Driver is used to exchange data with
Smartcards that do not support T=0 or T=1 (e.g. GPM256, GPM896, GFM,
GAM, etc...). The validated command is used to customize the GPR400 or
to create a new command.
Command Format
T = 70h
L = 03
V = DIR, ADR
where : DIR :
b1..b0 : 00 : downloaded IC driver
01, 10 : RFU
11 : specific command driver
b2 : 0 : driver located in RAM
1 : driver located in flash
b3 : (if b2=1) b3=0: first page of flash,
b3=1: second page of flash
b6..b4 : RFU
b7 : b7=0 : current driver invalid
b7=1 : current driver valid
ADR : address on two bytes of the beginning of the driver (MSB, LSB)
Answer Format
Type Ta = Tc + 02h (72h)
Length L = 01
Variable V = Reader Status Code (1 byte)

SENDING COMMANDS TO THE READER
GEMPLUS 14
Reset GPR
This command is not controlled by the GPR400. It is directly accessed
from the Handshake Register (refer to the “Handshake Register” section).
Power Down GPR
This command puts the GPR400 in low-consumption mode (Standby or
Power Down modes).
In Standby mode, when a Smartcard is inserted, a TLV Answer and an
interrupt signal are sent to the Host. If a Smartcard is already inserted, the
TLV is the GPR400’s only answer.
Note: This command does not power down the Smartcard interface (use
the Close Session command ).
Power Down is the GPR400’s very low-consumption mode (this applies
only if a “CLOSE SESSION” has been executed).
To reactivate the reader, you need to perform a “RESET GPR” before
sending any commands (refer to the “Handshake Register” section ).
Command Format
T = 40h
L = 01
V = 00 :Power down mode
01: Standby mode
Answer Format
Type Ta = Tc + 02h (42h)
L = 01
V = Reader status byte
Answer Format (Smart card insertion event only)
Type Ta = Tc + 02h (42h)
L = 02
V = Reader status byte + Aah

SENDING COMMANDS TO THE READER
GEMPLUS 15
Load Memory
This command downloads bytes to the RAM or to the optional Flash
Memory. The data comes from the host or from the Smartcard.
Note: The memory is divided into two 64-Kbyte pages and/or four 16-Kbyte
partitions for the Flash option.
Command Format
T = 60h
L = Length of V field
V = DIR, ADR, (Vex), (Data)
where
DIR :
b1.b0 : 00: data from the Smartcard
10: data from the Host
01,11: RFU
b2 : 0 : loading to RAM
1 : loading to Flash Memory
b3 : if b2=1, b3 indicates the page ( 0 = page 0, 1 = page 1 )
b5.b4 : 00 : downloading without erasing
10 : erasing the current 16 Kb partition before downloading
01 or 11: complete erasing before downloading
b6..b7 : RFU
ADR : physical address on two bytes (MSB, LSB)
Vex : (exclusive) : Smartcard command for data coming from a Smartcard
Data : (exclusive) : Data to load (for data coming from the host )
Answer Format
Type Ta = Tc + 02h
Length L = 01
Variable V = Reader Status Code
Table of contents
Other Gemplus Card Reader manuals
Popular Card Reader manuals by other brands

Addonics Technologies
Addonics Technologies ADCFAEU3 user guide

SanDisk
SanDisk SDDR-01 - ImageMate External Parallel CompactFlash Card... user guide

Nedap
Nedap Invexs 170 Series Quick Install Sheet

Lenovo
Lenovo Gemplus 41N3005 user guide

Identive
Identive TouchSecure quick start guide

Manhattan
Manhattan 102049 instructions

Vertiv
Vertiv CYBEX SCMDR0001 Quick installation guide

Motorola
Motorola FlexPass OFR100 OPERATING AND INSTALLATION Manual

Elecom
Elecom MR-SMC07 series user manual

Alarm Lock
Alarm Lock AL-PRE2 user guide

FONGWAH
FONGWAH E7 user manual

Sony
Sony MRW62E - USB 2.0 Flash Memory Card Reader operating instructions