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?
Answer
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:
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 request10
(PPS0) indicates that PPS1 is present and requests T=095
(PPS1) requests F=9 and D=57A
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.
No comments:
Post a Comment