1
\$\begingroup\$

I am trying to transceive information between an embedded processor and a smart-card device.

Default transition is done in: 9600 baudRate 3.58MHz clock pulse Fi=372 Di=1

After initial command between smart-card and processor I need to increase baud-rate (e.g. 115200).I must increase my clock frequency to 42.96MHZ for transceiving in 115200 bps,But unfortunately my processor is unable to generate this frequency.Then Can I change Fi or Di parameter to any other higher values for increasing baud-rate?

\$\endgroup\$
7
  • 3
    \$\begingroup\$ You've asked a few questions now and I see a couple that appear to have decent answers; have you considered that formally accepting an answer is a good way to repay the help you have received. Of course, you may think that none of the answers are good enough! \$\endgroup\$
    – Andy aka
    Commented Jan 25, 2017 at 8:58
  • 2
    \$\begingroup\$ Absolutely I receive great answers in my last questions but I'm not aware about any process for accepting answers(except voting up an answer).Is there any button/choice for accepting an answer?Thank you for your notice.EDIT: OK I found it,WBR. \$\endgroup\$ Commented Jan 25, 2017 at 9:22
  • \$\begingroup\$ Hm, wouldn't that be covered exactly in ISO/IEC 7816-3:2006(E) 8.3? \$\endgroup\$ Commented Jan 25, 2017 at 9:49
  • 3
    \$\begingroup\$ @Marcus Müller: but you don't get ISO/IEC 7816 for free. A free alternative for this purpose is ETSI TS 102 221: Smart Cards; UICC-Terminal interface; Physical and logical characteristics \$\endgroup\$
    – Curd
    Commented Jan 25, 2017 at 10:42
  • \$\begingroup\$ @MHD: at the top of the page there is a useful link called help > tour \$\endgroup\$
    – Curd
    Commented Jan 25, 2017 at 10:46

1 Answer 1

2
\$\begingroup\$

You don't need to change the clock rate that high (and it certainly wouldn't be supported by the card). You simply need to adjust Fi and Di, indeed.

Here is an extract from the ISO7816-3 spec:

enter image description here

To reach ~115200 bauds, typically, you'll choose Fi=512 (F=9) and Di=32 (D=5). This, with the same clock of 3.58MHz, will give 111875 bauds. For exactly 115200 bauds, you then need to set the clock to 3.6864MHz, but you certainly don't need to be that accurate. Note that the maximum clock rate that can be supported by the card depends on F and is indicated in the table, too (5MHz for F=9).

Now, in order to adjust Fi and Di, you need to send a PPS (Protocol Parameter Selection) request to the card (see chapter 9 of the spec). For example, you just send FF10957A to negociate T=0, F=9, D=5. Here is the meaning of each byte:

  • FF (PPSS) identifies a PPS request
  • 10 (PPS0) indicates that PPS1 is present and requests T=0
  • 95 (PPS1) requests F=9 and D=5
  • 7A is the XOR checksum

If the card accepts the request, it will acknowledge it by resending the exact same bytes back, and then change its baud rate.

Note that the maximum F and D values that the card can support are given in the ATR, (in the TA1 byte) so you know what you can negociate.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks for excellent answer,but how non-exact clock frequency does not affect to successful transition ?As I know new smart cards only use this clock pulses for synchronizing .Then I think any differences in clock frequency will cause a different ETU,which itself will cause mistake in receiving correct data. AM I true ? \$\endgroup\$ Commented Jan 29, 2017 at 9:23
  • 1
    \$\begingroup\$ The communication between host and card is synchronous, the baud rate (and ETU) is directly related to the clock frequency. Since both parties know this same clock (it is sent to the card, unlike a traditional UART where there is no clock sent), how could there be a difference in clock frequency? There is no such risk. \$\endgroup\$
    – dim
    Commented Jan 29, 2017 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.