TS: initial character
The ISO 7816-3 specification is not public. So I can't copy/paste part of the text. I will use Wikipedia instead.From Wikipedia https://en.wikipedia.org/wiki/Answer_to_reset#Initial_character_TS:
Initial character TS
The initial character TS encodes the convention used for encoding of the ATR, and further communications until the next reset. In direct [resp. inverse] convention, bits with logic value ‘1’ are transferred as a High voltage (H) [resp. a Low voltage (L)]; bits with logic value ‘0’ are transferred as L [resp. H]; and least-significant bit of each data byte is first (resp. last) in the physical transmission by the card.
For direct convention, TS is (H) L H H L H H H L L H (H) and encodes the byte ‘3B’.
For inverse convention, TS is (H) L H H L L L L L L H (H) and encodes the byte ‘3F’.
[ (H) represents the idle (High, Mark) state of the I/O line. The 8 data bits are shown in italic. ]
Bits in bytes following TS in the ATR, and further communications until the next reset, are numbered 1st to 8th from low-order to high-order, and their value noted 0 or 1, regardless of the chronological order and electrical representation, defined by TS. The bit following the 8 data bits in these bytes is an even parity bit, that is such that there's an even number of ‘1’ bits (H or L according to the direct or inverse convention defined by TS) among the 8 data bits and the parity bit.
TS also allows the card reader to confirm or determine the ETU, as one third of the delay between the first and second H-to-L transition in TS. This is optional, and the principal definition of ETU in the ATR of standard-compliant asynchronous Smart Cards is 372 periods of the clock received by the card
This first byte is used to indicate how bits and bytes are encoded at the electrical level: direct or inverse convention.
This choice has no impact on performances. As you can see, the vast majority of cards (94%) are using the direct convention (0x3B).
TS | # | % |
---|---|---|
0x3B | 1945 | 93.87 % |
0x3F | 127 | 6.13 % |