Professional Documents
Culture Documents
v.1.0
Dario Leone for MOAI Corporation Inc.
All Rights Reserved
Table Of Contents
Revision History ............................................................................................................. 4
Common Chip Features ................................................................................................. 5
Firmware Mask ROM ...................................................................................................... 6
Mask ROM F................................................................................................................ 6
Mask ROM S ............................................................................................................... 6
USB Descriptor ............................................................................................................... 7
Identification timing of smart card insertion ................................................................ 8
Unique Serial Number .................................................................................................... 9
USB Port Mode ............................................................................................................. 10
External EEPROM ......................................................................................................... 11
Escape commands ....................................................................................................... 12
Special Commands ...................................................................................................... 13
SC_Get_Chip_Type .................................................................................................... 13
SC_Get_Serial_Number.............................................................................................. 13
SC_Read_EEPROM ................................................................................................... 14
SC_Write_EEPROM ................................................................................................... 14
SC_Pin_Control........................................................................................................... 14
Memory Card Commands ............................................................................................ 15
2 Wire Commands Summary ...................................................................................... 16
2W_Read_Main_Memory ............................................................................................ 16
2W_Update_Main_Memory ......................................................................................... 16
2W_Read_Protection_Memory ................................................................................... 17
2W_Write_Protection_Memory.................................................................................... 17
2W_Read_Security_Memory ...................................................................................... 17
2W_Update_Security_Memory ................................................................................... 18
2W_Compare_Verification_Data ................................................................................. 18
3 Wire Commands Summary ...................................................................................... 19
3W_Write_Erase_WP ................................................................................................. 19
3W_Write_Erase_No_WP ........................................................................................... 20
3W_Write_Protect_Bit_DC .......................................................................................... 20
SCS Technical Specifications v1.0 Dario Leone for MOAI Corporation
Page 2 of 25
3W_Read_Data_WP ................................................................................................... 21
3W_Read_Data ........................................................................................................... 21
3W_PSC_Verification .................................................................................................. 22
I2C Commands Summary ........................................................................................... 23
I2C_Read_Data........................................................................................................... 24
I2C_Write_Data ........................................................................................................... 24
Status Code Table ........................................................................................................ 25
Page 3 of 25
Revision History
Version
V1.0
Date
July 2014
Description
Initial version
Page 4 of 25
100% crystaless
Unique 32bits chip device serial number
ISO7816 Interface with support of T=0, T=1, 2Wire, 3Wire, I2C protocols
Customizable USB descriptor via external EEPROM
Page 5 of 25
Mask ROM F
This mask ROM include the following features:
The current free GPIO will be used as hardware switch se enable/disable the following
feature:
Feature Description
ISO7816 USB Interface Mode
Default
Pull Down
Pull Up
HID CCID
Pull Down
USB CCID
Mask ROM S
This mask ROM include the following features:
The current free GPIO will be used as hardware switch se enable/disable the following
feature:
Feature Description
ISO7816 USB Interface Mode
Default
Pull Down
Pull Up
HID CCID
Pull Down
USB CCID
The ISO7816 USB Interface switch change the bInterfaceClass of this peripheral. The two
available value will be:
bInterfaceClass
0x0B
0x03
Meaning
Chip/Smart Card USB Device
HID Interface Class
Page 6 of 25
USB Descriptor
The default USB descriptor of devices will be the following:
Interface
ISO7816
ISO7816
ISO7816
ISO7816
Descriptor Type
Device Descriptor
Device Descriptor
Device Descriptor
Device Descriptor
Customizable Field
0x14CD
0x 0900
Generic
USB Smart Card Reader
Device Descriptor
Device Descriptor
Device Descriptor
Device Descriptor
0x 14CD
0x 0901
Generic
Flash Disk Drive
SD Card
SD Card
SD Card
SD Card
Device Descriptor
Device Descriptor
Device Descriptor
Device Descriptor
0x 14CD
0x 0902
Generic
Card Reader
Page 7 of 25
Out of standard
Sufficient
Good
Excellent
Page 8 of 25
Page 9 of 25
Page 10 of 25
External EEPROM
The device can be customized through the addition of an external EEPROM. The structure
of the EEPROM must allow customization of the following parameters:
Interface
ISO7816
ISO7816
ISO7816
ISO7816
Descriptor Type
Device Descriptor
Device Descriptor
Device Descriptor
Device Descriptor
Customizable Field
Vendor ID
Product ID
Manufacturer String
Product String
Device Descriptor
Device Descriptor
Device Descriptor
Device Descriptor
Vendor ID
Product ID
Manufacturer String
Product String
Page 11 of 25
Escape commands
The PC_to_RDR_Escape HOST command activate IFD-dependent feature(s).
The Escape command are user for Special Commands and Memory Card Commands
Offset
0
Field
bMessageType
Size
1
Value
0x6B
dwLenght
bSlot
0x00 to 0xFF
bSeq
0x00 to 0xFF
abRFU
10
abData
Byte Array
Description
Size of abData field of
this message
Identifies the slot number
for this command
Sequence number for
command
Reserved for Future Use
Data block sent to the
CCID
Page 12 of 25
Special Commands
We can talk directly with the chip controller throught the ESCAPE commands.
SC_Get_Chip_Type
Host sends out Get Chip Type command to get the chip type, then the device send out the
chip type information to Host.
HEX
0x53, 0x43, 0x53, 0x2d, 0x46
0x53, 0x43, 0x53, 0x2d, 0x53
ASCII
SCS-F
SCS-S
SC_Get_Serial_Number
Host sends out Get Serial Number command to get the chip unique serial number.
This is the chip serial number and not the USB descriptor serial number.
Page 13 of 25
SC_Read_EEPROM
If the device use external EEPROM we can read the values throught the following escape
commands.
0xD5
LEN
Response Data
Status
Data
See status code table Data bytes
SC_Write_EEPROM
If the device use external EEPROM we can write the values throught the following escape
commands.
0xD5
Data to Write
Response Data
Status
Data
See status code table Data bytes
SC_Pin_Control
Page 14 of 25
Page 15 of 25
Command
Read Main Memory
Update Main Memory
Read Protection Memory
Write Protection Memory
Read Security Memory
Update Security Memory
Compare Verification Data
0xD9
0xD9
0xD9
0xD9
0xD9
0xD9
0xD9
2W_Read_Main_Memory
Read main memory from starting address (aa) with expected length (bb) of return data.
0xD9
0x70
0x00
Response Data
Status
Data
See status code table Expected data
2W_Update_Main_Memory
Update specific length of data to main memory.
0xD9
0x71
0x00
Response Data
Status
Data
See status code table
--
Page 16 of 25
2W_Read_Protection_Memory
Read four bytes of data from protection memory.
2W_Write_Protection_Memory
Write specific length of data to memory that is protected by protect bits.
When the corresponding protect bit is equal to 0, nothing changed will be applied.
When the corresponding protect bit is equal to 1 and the data passed with Command Data
is the same with data in memory and then the protect bit will be set to 0.
That is the memory associated with the protect bit is locked and cannot be changed
anymore.
0xD9
0x73
0x00
Response Data
Status
Data
See status code table
Data bytes
2W_Read_Security_Memory
Read four bytes of data from security memory.
Page 17 of 25
2W_Update_Security_Memory
Update specific length of data to security memory.
0xD9
0x75
0x00
Meaning
Error Counter
Verification Code 1
Verification Code 2
Verification Code 3
Response Data
Status
Data
See status code table
-2W_Compare_Verification_Data
Perform Compare Verification Data
0xD9
0x76
byte 2
byte 3
Response Data
Status
Data
See status code table
--
Page 18 of 25
Command
Write/Erase with protect bit
Write/Erase w/o protect bit
Write protect bit with comparasion
Read data with protect bit (9bits)
Read data (8bits)
PSC Verification
hb: high byte of the starting address, the value range from 0x00 to 0x03
lb: low byte of the starting address, the value range from 0x00 to 0xFF
len: expected length of return data or length of data to write
3W_Write_Erase_WP
Write and erase with protected bit. Write or erase the desire data into memory and change
the associated protect bits from 0x01 to 0x00. The memory is protected (locked) cant be
changed by further write or erase command
0xD9
0x60
High byte
starting
address
Response Data
Status
Data
See status code table
--
Page 19 of 25
3W_Write_Erase_No_WP
Write and erase without protected bit. Write or erase the desire data into memory. The
associated protect bits are left unchanged.
0xD9
0x61
High byte
starting
address
Response Data
Status
Data
See status code table
--
3W_Write_Protect_Bit_DC
Write protected bit with data comparison.
Comparing with the input data and the content of memory, if they have the same value, the
value of the protected bit will be changed from 0x01 to 0x00.
Otherwise, the value of the protected bit will not be changed.
0xD9
0x62
High byte
starting
address
Response Data
Status
Data
See status code table
--
Page 20 of 25
3W_Read_Data_WP
Read data along with associated protect bits.
0xD9
0x63
Response Data
Status
See status code table
Data
Data1, protect1dataNN, protectNN
If the value of protect(NN) = 1, the memory associated with the protect bit is not protected
(locked).
If the value of protect(NN) = 0, the memory associated with the protect bit is protected
(locked).
3W_Read_Data
Read data starting with the address that specified by the high byte of the starting address
and the low byte of the starting address with the specific length of return data.
0xD9
0x64
Response Data
Status
Data
See status code table Data bytes
Page 21 of 25
3W_PSC_Verification
Verify two bytes of PSC-code
0xD9
0x02
Byte1
Byte2
Response Data
Status
Data
See status code table
--
Page 22 of 25
Command
Read Command
Write Command
Read body
Write body
Meaning
one byte command without any address byte
one byte command with one address byte
one byte command with two address bytes
not allowed
Meaning
not use dummy write address before reading
need to use dummy write address before reading
not allowed
Page 23 of 25
I2C_Read_Data
Read data with specific length of return data
0xD8
0x50
Read Body
Response Data
Status
Data
See status code table Data bytes
I2C_Write_Data
Read data with specific length of return data
0xD8
0x51
Write Body
Response Data
Status
Data
See status code table Data bytes
Page 24 of 25
Descriptions
No error
Type Error
No Response
Power Fail
Communication Error
Command Error
Card Locked
Verify Fail
Write Error
Counter Empty
ATR Error
PTS Error
Not Supported
Card Absent
Page 25 of 25