Gemplus GPR400 Reference Manual

Page 1
Version 1.3
GPR400
Reference Manual
Page 2
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
Page 3
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.
Page 4
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
Page 5
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
Page 6
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 1 below. 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.
Page 7
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.
Page 8
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
Page 9
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.
Page 10
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).
Page 11
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
Page 12
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)
Page 13
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.
Page 14
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.
Page 15
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
Page 16
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
Page 17
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)
Page 18
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)
Page 19
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
Page 20
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
Page 21
SENDING COMMANDS TO THE READER
GEMPLUS 16
Read Memory
This command reads bytes from the RAM or from the optional Flash Memory.
Command Format
T = 80h L = Length of V field V = DIR, ADR, Lng
where : DIR : b0..b1 : RFU b2 = 0 : read from RAM
1 : read from flash memoryb3 : (if b2=1) b3 indicates the page (0=
first 64-Kbyte block, 1= second block) b4..b7 : RFU ADR : physical address on two bytes (MSB, LSB) Lng : number of bytes to be read (00 = 256 bytes ) Answer Format Type Ta = Tc + 02h Length L = Length of V field Variable V = Reader Status Code, Vinf Vinf corresponds to the data read.
Page 22
SENDING COMMANDS TO THE READER
GEMPLUS 17
Exec Memory
This command executes a specific command (sub-routine) pre-downloaded using the “LOAD MEMORY” command. This subroutine should normally be generated by GEMPLUS.
The driver can be downloaded a single time to non-volatile memory (i.e., the External Flash Memory), provided that the “VALIDATE DRIVER” command has already been executed.
Command Format
T = 90h L = Length of V field V = User Data where : The subroutine uses available User Data as parameters. Answer Format Type Ta = Tc + 02h (92h) Length L = Length of V fi eld Variable V = Reader Status Code , Answer User Data (user
defined).
Status GPR
This command provides 3 types of information on the GPR400’s status: firmware, Smartcard and driver information.
Command Format
T = A0h L = 01 V = b7...b0 where: b1..b0 = 00: GPR400 firmware information 01: checksum information (GPR400 firmware, RAM and
Flash Memory) 10: Smartcard register 1 & 2 b7 ...b2 : RFU.
Page 23
SENDING COMMANDS TO THE READER
GEMPLUS 18
Answer Format
Type Ta = Tc + 02h (A2h) Length L = Length of V field Variable V = Reader Status Code , information Data for GPR400 firmware information (7 bytes), Data=OS version: Binary Coded Decimal byte Mem: 00h if Flash Memory absent 11h if Flash Memory present
General Setup Register byte
DIR and ADR bytes of the “Validate Driver” command fields
PC Card Manufacturer info byte (LSB): see PCMCIA
Standard
for checksum information (2 or 3 bytes) , Data =
Checksum GPR400 firmware
Checksum RAM
Checksum Flash Memory (optional)
for Smartcard information (3 bytes), Data =
Smartcard register 1
Smartcard register 2
Clock & Control register.
Page 24
GEMPLUS 19
APPENDIX A - OPERATING SPECIFICATIONS
This appendix specifies the GPR400's operating conditions, including :
maximum operating values
operating conditions
AC test conditions
AC characteristics
Maximum Operating Values
Table 3 lists the GPR400's maximum operating conditions.
Table 3. GPR400 Maximum Operating Conditions
Condition Value
Operating temperature 0ºC to + 55ºC Storage temperature -20ºC to + 65ºC Voltage on any PIN with respect
to ground
-0.5V to + 5.5V
Vpp supply voltage with respect to ground
-0.5V to + 7.0V
Vcc supply voltage with respect to ground
-0.5V to + 5.5V
Note: Conditions outside the values specified in Table 3 may cause
permanent damage to the GPR400.
Page 25
APPENDIX A - OPERATING SPECIFICATIONS
GEMPLUS 20
Standard Operating Conditions
Table 4 lists the GPR400's standard operating conditions.
Table 4. GPR400 Standard Operating Conditions
Symbol
Parameter Limits Unit Test Conditions
Min Typ Max
Ta Operating
temperature
0 70 º C
Vcc Vcc supply voltage 4.8 5.25 V
Vpph Active Vpp supply
voltage (if needed)
4.5 5.5 V
Vppl Vpp during read
operations
0 5.5 V
ILi Input leakage current 5 uA Vcc = Vcc Max Vin = Vcc or Vss
ILo Output leakage
current
1 15 uA Vcc = Vcc Max Vout = Vcc or Vss
Iccpd Icc power down
current
200 500 µA Vcc = Vcc Max CE/ = Vcc
Iccop Icc operating current
4
20 mA Vcc = Vcc Max CE/ = Vil with no
IccSmartcard inserted.
Vil Input low voltage -0.5 0.8 V
Vih Input high voltage 2.2 Vcc+0
.5
V
Vol Output low voltage 0.40 V lol = 3.2 mA Vcc = Vcc min
Voh Output high voltage 2.4 V loh = -2 mA Vcc = Vcc min
Vppl Vpp during read only
operations
0 6.5 V
Vpph Vpp during read/write
operations
4.5 5.5 V
Page 26
APPENDIX A - OPERATING SPECIFICATIONS
GEMPLUS 21
AC Test Conditions
The GPR400 AC Test conditions are listed below: Input rise and fall times 10 ns Input pulse levels Vol and Voh Input timing reference level Vil and Vih Output timing reference level Vil and Vih
AC Characteristics
The GPR400 AC Characteristics are listed below: Read access time 55 ns Write access time 55 ns (Attribute Memory and I/O buffer)
Page 27
GEMPLUS 22
APPENDIX B - PIN-OUT DESCRIPTION
Table 5 describes the GPR400 PIN-OUT. Table 5. GPR400 PIN-OUT.
PIN Signal I/O Function PIN Signal I/O Function
1 GND I/O Ground 35 GND O Ground 2 D3 I/O Data bit 3 36 CD1 I/O Card Detect 1 3 D4 I/O Data bit 4 37 D11 I/O N.C. 4 D5 I/O Data bit 5 38 D12 I/O N.C. 5 D6 I/O Data bit 6 39 D13 I/O N.C. 6 D7 I/O Data bit 7 40 D14 I/O N.C. 7 CE1 I PC Card Enable 41 D15 I/O N.C. 8 A10 I Add. bit 10 42 CE2 I N.C. 9 OE I Output EN 43 NC N.C. 10 A11 I Add bit 11 44 IORD I I/O read 11 A9 I Add bit 9 45 IOWR I I/O write 12 A8 I Add bit 8 46 A17 I N.C 13 A13 I Add bit 13 47 A 18 I N.C. 14 A14 I Add bit 14 48 A 19 I N.C. 15 WE I Write enable 49 A 20 I N.C. 16 IREQ O Interrupt line 50 A 21 I N.C. 17 Vcc 1 I Power Supply 51 Vcc 2 Power Supply
Page 28
APPENDIX B - PIN-OUT DESCRIPTION
GEMPLUS 23
PIN Signal I/O Function PIN Signal I/O Function
18 Vpp1 I Program Power
Supply
52 Vpp2 N.C.
19 A16 I N.C. 53 A22 I N.C. 20 A15 I N.C 54 A23 I N.C. 21 A12 I N.C 55 A24 I N.C. 22 A7 I Add bit 7 56 A25 I N.C. 23 A6 I Add bit 6 57 RFU N.C 24 A5 I Add bit 5 58 RST I Reset 25 A4 I Add bit 4 59 WAIT O N.C. 26 A3 I Add bit 3 60 Inpack O Valid access 27 A2 I Add bit 2 61 REG I Reg. Valid 28 A1 I Add bit 1 62 BVD2 O Bat Volt Detect 29 A0 I Add bit 0 63 BVD1 O Bat Volt Detect 30 D0 I/O Data bit 0 64 D8 I/O N.C. 31 D1 I/O Data bit 1 65 D9 I/O N.C. 32 D2 I/O Data bit 2 66 D10 I/O N.C. 33 WP O Ground 67 CD2 O Card Detect 2 34 GND Ground 68 GND Ground
Page 29
APPENDIX B - PIN-OUT DESCRIPTION
GEMPLUS 24
The PINs are described below. A0 - A11 (Input): addresses A0 through A11 are address bus lines allowing
you to issue instructions directly to the Attribute Memory or to the I/O buffer.
D0 - D7 (input/output): signals D0 through D7 make up the bi-directional data bus. D7 is the most significant bit.
CE1 (input): GPR400 enable input signal. Active low. OE (input): signal used to read the Attribute Memory. Active low. WE (input): signal used to write Attribute Memory. Active low. IORD (input): signal used to read I/O buffer. Active low. IOWR (input): signal used to write in I/O buffer. Active low. REG (input): signal to enable GPR400 access (Attribute Memory and I/O
buffer) INPACK (output): indicates the GPR400 is inserted (correct I/O address).
Active low. IREQ :(output) : Interrupt Request signal, indicates to the host that an
answer is available. CD1,CD2 (outputs): these signals detect whether the GPR400 is inserted
or not. They are internally connected to the ground. Vcc: GPR400 power supply (5V nominal) for all internal circuitry. Vpp1: programming power supply, if the optional Flash Memory is present. GND: ground for all internal circuitry. BVD1, BVD2 (outputs): battery voltage detection. These signals are
internally driven high to maintain SRAM Smartcard compatibility. RST (= RESET) : must be set to 1 by the host to reset the GPR400, then
reset to 0 during at least 20 ms.
Page 30
© GEMPLUS 25
APPENDIX C - SAMPLE GPR400 SCENARIOS
This appendix provides sample scenarios.
Scenario 1
GPR400 configuration at address 0240h in the host PC system resources. This scenario is automatically done by the Socket and Card Services
(PCMCIA Standard) if it is found in the host (in compliance with PCMCIA standard rel 2.1).
- Set the GPR400 power on.
- Read the C.I.S. in the Attribute Memory.
- Write (Attribute Memory ) at address 0FA0h the value 12h (as mentioned in the C.I.S. configuration).
Scenario 2
Send an ISO command to a Smartcard. ( protocol T = 1 ; clock = 3.58 MHz ) Reset GPR : write I/O at @ 0240h (Handshake Register) : bit 0 set to 1
and reset to 0,5 us later. Select Card : T.L.V. = 50.01.02 write I/O @0242h: 50h, @0243h 01h, @0244h 02h write I/O @0240h : bit 1 set to 1 wait for Interrupt Request ( IREQ ) then write I/O @0240h bit 2 reset to 0 read I/O @0242h 52h, @0243h 01h, @0244h 00h
Page 31
APPENDIX C - SAMPLE GPR400 SCENARIOS
GEMPLUS 26
Open Session: T.L.V. = 20.00.
write I/O @0242h 20h, @0243h 00h. write I/O @0240h : bit 1 set to 1 wait for Interrupt Request ( IREQ ) then write I/O @0240h bit 2 reset to 0 read I/O @0242h 22h, @0243h 01h, @0244h 00h
APDU Exchange : T.L.V. = 30.L.(Nad, Pcb, Le, Vinf, E) write I/O @0242h: 30 L.(Nad, Pcb, Le, Vinf, E) write I/O @0240h : bit 1 set to 1 wait for Interrupt Request ( IREQ ) then write I/O @0240h bit 2 reset to 0 read I/O @0242h : 32.L.(Nad, Pcb, Le, Vinf, E)
Close Session : T.L.V. = 10.00.
write I/O @0242h: 10.00 write I/O @0240h : bit 1 set to 1 wait for Interrupt Request ( IREQ ) then write I/O @0240h bit 2 reset to 0 read I/O @0242h : 12.01.00
PowerDown GPR : T.L.V. = 40.01.00.
write I/O @0242h: 40.01.00 write I/O @0240h : bit 1 set to 1 wait for Interrupt Request (IREQ) then write I/O @0240h bit 2 reset to 0 read I/O @0242h : 42.01.00.
Page 32
APPENDIX C - SAMPLE GPR400 SCENARIOS
GEMPLUS 27
Scenario 3
Send an ISO command to a new Smartcard. (protocol T = X, clock = 3.68 MHz )
Reset GPR : write I/O at @ 0240h (Handshake Register) : bit 0 set to 1
and reset to 0,5 us later.
Load memory : ( Download X driver for the new Smartcard) T.L.V. = 60.L < 01,ADH,ADL,DATA > T.L.V. = 60.L. < 01,ADHnext, ADLnext, DATA > until the entire driver corresponding to protocol X is
downloaded
write I/O @0242h: 60 L <00,ADH, ADL, DATA > write I/O @0240h : bit 1 set to 1 wait for Interrupt Request ( IREQ ) then write I/O @0240h bit 2 reset to 0 read I/O @0242h : 62.01.00 .. and loop until last data appears.
Activate driver T.L.V. = 70.03.81.ADh,ADl ADh, ADl : base driver address. write I/O @0242h: 70.03.80.ADh,ADl write I/O @0240h : bit 1 set to 1 wait for Interrupt Request (IREQ) then write I/O @0240h bit 2 reset to 0 read I/O @0242h : 72.01.00.
Select Card :
Page 33
APPENDIX C - SAMPLE GPR400 SCENARIOS
GEMPLUS 28
T.L.V. = 50.01.00 selection of Smartcard driver, clock = 3.68 MHz write I/O @0242h: 50 01 00 write I/O @0240h : bit 1 set to 1 wait for Interrupt Request (IREQ) then write I/O @0240h bit 2 reset to 0 read I/O @0242h : 52.01.00.
Open Session : T.L.V. = 20.00. write I/O @0242h: 20.00 write I/O @0240h : bit 1 set to 1 wait for Interrupt Request (IREQ) then write I/O @0240h bit 2 reset to 0 read I/O @0242h : 22.01.00.
APDU Exchange : T.L.V. = 30.L.Vex The Vex Variable can be structured as T=0 or T=1
or it can have a specific format. It will be handled by the new Smartcard driver.
write I/O @0242h: 30 L.Vex write I/O @0240h : bit 1 set to 1 wait for Interrupt Request (IREQ) then write I/O @0240h bit 2 reset to 0 read I/O @0242h : 32.L.Vex.
Page 34
APPENDIX C - SAMPLE GPR400 SCENARIOS
GEMPLUS 29
Close Session: T.L.V. = 10.00. write I/O @0242h: 10.00 write I/O @0240h : bit 1 set to 1 wait for Interrupt Request (IREQ) then write I/O @0240h bit 2 reset to 0 read I/O @0242h : 12.01.00.
PowerDown GPR : T.L.V. = 40.01.00. write I/O @0242h: 40.01.00 write I/O @0240h : bit 1 set to 1 wait for Interrupt Request (IREQ) then write I/O @0240h bit 2 reset to 0 read I/O @0242h : 42.01.00.
Page 35
© GEMPLUS 30
APPENDIX D - STATUS CODES
Status codes provided by the GPR400 are listed in the table below:
Code Meaning
00 Command successfully executed. 04h Unknown reader command. The first byte of the
request is not a valid command type.
05h Unknown Smartcard driver. The driver was not
loaded.
10h Response error at card reset. The first byte of the
response (TS) is not valid.
12h The L parameter is not valid; chaining buffer overflow
or chaining Li value <> 28.
14h Unknown card type. The T parameter in the Define
Card Type command is not valid.
15h Card turned off. A Power Up command must be
given to the card prior to any other operation. 16h The V parameter is incorrect. 19h The Flash Memory is not present. The command is
not supported. 1Ah Error in an ISO format card command. The LN
parameter in the ISO header does not correspond to
the actual data length. 1Bh A command has been sent with an incorrect number
of parameters. 1Dh The TCK check byte of an asynchronous card
Answer To Reset is incorrect. 1Eh Memory access is incorrect. 1Fh Writing problem in the Flash Memory. 20h Bad TLV command type <T>.
Page 36
APPENDIX D - STATUS CODES
GEMPLUS 31
A0h Card malfunction; the TA1 byte of an asynchronous
card Answer To Reset is incorrect. The Smartcard
protocol is not accepted. A2h Card malfunction. The card is not responding to
reset or has int errupted an exchange (by time-out). A3h Parity error (in the course of an exchange between
the asynchronous card and the reader). The error
only occurs after several unsuccessful attempts at
retransmission. E4h The card has just sent the reader an invalid
"Procedure Byte" (see ISO 7816-3). E5h A command was issued, but no data was
exchanged. E7h The SW1 and SW2 bytes returned by the card are
not 90 00h. F7h Card removed; the card has been withdrawn while
carrying out of an instruction. Make sure that the
card instruction is complete. F8h Card in short circuit. FBh Card absent. There is no card in the connector. The
card may have been removed when powered on, but
no instruction has been interrupted.
Loading...