User Manual

Table Of Contents
Coupler - Reference manual
RM 5
Version 1.0
PROTOCOL CONFIGURATION
In order that the coupler knows how much data it is supposed to receive and suppose to
send back, the CLASS byte is used to indicate how it should operate. The default value
for the CLASS byte is 0x80. To implement the block mode, the three first bits have been
used.
CLASS BITS
(MSB..LSB)
CLASS
VALUE
MEANING
10000000 0x80 Standard ISO-7816-3 T=0 protocol
10000001 0x81 Block protocol with no data from host
and back from coupler
10000011 0x83 Block protocol with no data down from
host and P3 data back from coupler
10000100 0x84 Block protocol with P3 data down from
host and no data back from coupler
10001000 0x88 Block protocol with P3 data down from
host and P1 data back from coupler
10001100 0x8C Block protocol with P3 data down from
host and P2 data back from coupler
10001110 0x8E Block protocol with P3 data down from
host and P3 data back from coupler
LRC
The block diagram mentions an optionnal LRC (Longitudinal Redundancy Checksum) or
CRC (Cyclic Redundancy Checksum) can be appended in the flow. This option is controlled
by a parameter into the coupler configuration which can be set via the command
SET_STATUS.
Calculation
LRC is the result of the XOR of all the bytes sent by the host including command and the
P3 data bytes. If the LRC does not correspond to the LRC calculated by the coupler, the
coupler will response with a status word equal to $6F$00.
The example below shows how the LRC is calculated:
$82$C0$00$00$03 + $01$02$03 + $41 because $41 = $82 xor $C0 xor $00 xor $00 xor
$03 xor $01 xor $02 xor $03.
The LRC calculation is equivalent to the CRC8 calculation with a poly equal to 1.