Carlos,

Use the current (1997) edition of 7816-3, not the obsolete (1989) edition.
Its still not easy to do the calculations, so readers of this note should
check it over carefully.

7816-3:1997 section 8.2 on work waiting time:

wwt = 960 * WI * (Fi / f)

f = card clock frequency - let us assume 3571200 Hz (3.5712 MHz)

Fi is the clock rate conversion factor. It is coded as FI in the top 4 bits
of ATR interface byte TA(1), and Table 7 is used to find the value of Fi. If
TA(1) is not present, the default value of Fi is 372 (see below about this
muddle).

WI is coded in ATR specific interface byte TC(2); the default value if TC(2)
is not sent by the card is 10

Using default values and the assumed card clock frequency of 3571200, we
have:

wwt = 960 * 10 * (372 / 3571200) = 1 second

For the calculation of the etu (elementary time unit, or bit period on the
I/O line), another factor comes in. 7816-3:1997 section 6.5.2:

1 etu = (F / D) * (1 / f)

First, one of 7816-3's muddles must be cleared out of the way:

if interface byte TA(1) is present, F = Fi as found via Table 7 (see above);
if TA(1) is not present, F = Fd = 372;
but if a successful PPS exchange in which the interface device sends PPS1 to
request the card to accept values of F and D takes place, F = Fn as sent
back by the card. (PPS is the new name for PTS)

D is the extra factor: the I/O line bit rate adjustment factor (e.g.
changing D from the default 1 to the value 2 halves the length of the etu,
or doubles the bit rate). The same muddle as for F applies:

first, it is coded as DI in the bottom 4 bits of ATR interface byte TA(1),
and Table 8 is used to find the value of Di;
if TA(1) is not present, the default value of Di is Dd = 1;
and a PPS exchange can change D just as it can change F.

So, using default values and a clock rate of 3.5712 MHz:

1 etu = (372 / 1) * (1 / 3571200) = 1.04167 sec (104.167 microsec or, of
course, 1/9600 sec)

It seems, therefore, that changing the value of Di in the ATR does not
change the value of the wwt, but changing the value of Fi does. Is this what
the writers of 7816-3:1997 meant? I don't think so, because the wwt required
is related to the values of clock sent to the card, the internal structure
of the card's CPU and clock processing circuits, and the application
algorithm programmed into the card. Changing Fi and Di doesn't change the
way that the card runs its application code, and so should not change the
wwt - but changing Fi does change the wwt.

FI from the card, besides influencing I/O bit rate, also indicates the max
clock frequency that the card can be run at. So:

FI = 0 (means Fi = 372), Di = 1 gives a bit rate of 9600 in our example, a
wwt of 1 sec, and indicates (Table 7) a max clock frequency of 4 MHz
(typical for a card run at 3 Volts Vcc)

FI = 1 (also means Fi = 372), Di = 1 gives a bit rate of 9600 in our
example, a wwt of 1 sec, and indicates (Table 7) a max clock frequency of 5
MHz (typical for a low cost card run at 5 Volts Vcc)

FI = 3 (means Fi = 744), Di = 2 also gives a bit rate of 9600 in our
example, but changes the wwt to 2 sec, and indicates (Table 7) a max clock
frequency of 8 MHz (e.g. for a Hitachi 3109 card as used by "rollout spec"
Mondex in a single application environment)

Regards,

Peter Tomlinson

34 Strathmore Road, Horfield, Bristol BS7 9QJ, UK
phone & fax +44 (0)117 951 4755, mobile +44 (0)7968 947021
email [EMAIL PROTECTED] , web www.iosis.co.uk

----- Original Message -----
From: "Carlos Prados" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 02, 2001 6:39 PM
Subject: MUSCLE Work Waiting Time question


> Hi,
>
> I need some advice to interpretate the ISO 7816-3
> normative: ISO 7816-3 states that the Work Waiting
> Time for T=0 is calculated as follows:
>
> wwt = 960 * D * WI * work etu.
>
> I use this value as timeout for receiving chars from
> the card.
>
> I'm not sure how to calculate this value when etu =
> 1/9600 s (default value when there is no PTS):
>
> a) work etu = (1/D) * (F/fs) where fs=3571200
>
> So wwt is equals to:
>
> wwt = 960 * WI * F / 3571200
>
> For a cyberflex this gives 1376 ms and for cryptoflex
> 3200 ms.
>
> b) Use the actual work etu (1/9600 seconds):
>
> wwt = 960 * D * WI * (1/9600)
>
> For cyberflex this gives 8000 ms and for cryptoflex
> 3200 ms.
>
> Any advice is welcomed.
>
> Thanks,
> Carlos.
>
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail - only $35
> a year!  http://personal.mail.yahoo.com/
> ***************************************************************
> Linux Smart Card Developers - M.U.S.C.L.E.
> (Movement for the Use of Smart Cards in a Linux Environment)
> http://www.linuxnet.com/smartcard/index.html
> ***************************************************************
>

***************************************************************
Linux Smart Card Developers - M.U.S.C.L.E.
(Movement for the Use of Smart Cards in a Linux Environment)
http://www.linuxnet.com/smartcard/index.html
***************************************************************

Reply via email to