一些例子
NXP 080
=========
3b
f8 T0 Y1 = 0xF(TA1, TB1, TC1, TD1), K = 8
13 TA1 F = 0x1(Fi = 372, Fmax = 5MHz), D = 0x3(Di = 4)
00 TB1 deprecated
00 TC1 N = 0, extra guard time integer
81 TD1 Y2 = 0x8(TD2), T=1
31 TD2 Y3 = 0x3(TA3, TB3), T=1
fe TA3
45 TB3
4a 43 4f 50 76 32 34 31 History bytes
b7 TCK
JCOP white card
==================
3B
68 T0 Y1 = 6(TB1, TC1) , K = 8
TA1 = default 0x11, F = 0x1 (Fi = 372, Fmax = 5), D = 0x1(Di = 1)
00 TB1 deprecated
00 TC1 N = 0, extra guard time integer
00 73 C8 40 00 00 90 00 History bytes
Samsung withe card
====================
3B
9F T0 Y1 = 0x9(TA1,TD1), K = 0xF
95 TA1 F = 0x9(Fi = 512, Fmax = 5), D = 0x5(Di = 16)
80 TD1 Y2 = 0x8(TD2), T = 0
1F TD2 Y3 = 0x1(TA3), T= 15
C3 TA3
80 31 A0 73 BE 21 13 67
03 12 00 22 00 11 28
D5 TCK
从http://hi.baidu.com/fengling1234567/blog/item/00ab014f98538433aec3ab1d.html看到一篇文章:
ATR的基本结构与意义(无历史字符部分) [转载 for sim ic卡 atr pps]
Reset
3B FA 13 00 00 81 31 FE 45 4A 43 4F 50 34 31 56 32 32 31 96
复位应答 ATR
Reset
3B FA 13 00 00 81 31 FE 45 4A 43 4F 50 34 31 56 32 32 31 96
复位应答 ATR
TS( The Initial character ) = 3B
--表示正向约定,高电平为1,低电平为0,传输时先传输LSB,最后传输MSB
T0( The Format character ) = FA
--表示接口字符的个数和历史字节的数量
----其高4位有几个bit为1,则表示后续有几个历史字符(Historical bytes)
高4位 = f( 1 1 1 1 )表示后续字符中存在TA1 TB1 TC1 TD1
--------------------( TA1, TB1, TC1, TA2, TB2 是全局接口字符,TC2是专用接口字符 )
TA1 = 13
--表示有增强的波特率,公式 3571200 / ( Fi / Di )
--------其中Fi由TA1的高4位(F)查表得出,Di由TA1的低4位(D)查表得出
----F = 01 ,查下表,则Fi = 372
+-------------+--------+--------+--------+--------+--------+--------+--------+--------+
| F | 0000 | 0001 | 0010 | 0011 | 0100 | 0101 | 0110 | 0111 |
+-------------+--------+--------+--------+--------+--------+--------+--------+--------+
| Fi | 372 | 372 | 558 | 744 | 1116 | 1488 | 1860 | RFU |
+-------------+--------+--------+--------+--------+--------+--------+--------+--------+
| 最高时钟MHZ | 4 | 5 | 6 | 8 | 12 | 16 | 20 | -- |
+-------------+--------+--------+--------+--------+--------+--------+--------+--------+
| F | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 |
+-------------+--------+--------+--------+--------+--------+--------+--------+--------+
| Fi | RFU | 512 | 768 | 1024 | 1536 | 2048 | RFU | RFU |
+-------------+--------+--------+--------+--------+--------+--------+--------+--------+
| 最高时钟MHZ | -- | 5 | 7.5 | 10 | 15 | 20 | -- | -- |
+-------------+--------+--------+--------+--------+--------+--------+--------+--------+
----D = 03 ,查下表,则Di = 4
+-------------+--------+--------+--------+--------+--------+--------+--------+--------+
| D | 0000 | 0001 | 0010 | 0011 | 0100 | 0101 | 0110 | 0111 |
+-------------+--------+--------+--------+--------+--------+--------+--------+--------+
| Di | RFU | 1 | 2 | 4 | 8 | 16 | 1860 | RFU |
+-------------+--------+--------+--------+--------+--------+--------+--------+--------+
| D | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 |
+-------------+--------+--------+--------+--------+--------+--------+--------+--------+
| Di | RFU | 512 | 768 | 1024 | 1536 | 2048 | RFU | RFU |
+-------------+--------+--------+--------+--------+--------+--------+--------+--------+
--------实际波特率为 38400
TB1 = 00
----表示编程电流 I /电压 P,高2位表示电流I,低6位表示电压P
----高2位 = 00 ,则编程电流 I 如下
+-------+--------+--------+--------+--------+
| 高2位 | 00 | 01 | 10 | 11 |
+-------+--------+--------+--------+--------+
| 电流I | 25 | 50 | RFU | RFU |
+-------+--------+--------+--------+--------+
----低6位 = 00 ,则编程 P 电压为0
TC1 = 00
----额外保护时间N = 0
TD1 = 81
----通讯协议 T = 1
--------------------
没有TA2
没有TB2
没有TC2
TD2 = 31
--------------------
TA3 = FE
TB3 = 45
没有TC3
没有TD3
4A 43 4F 50 34 31 56 32 32 31
----是历史字节
TCK ( XOR T0 - TCK ) = 96 校验成功