Saturday, 5 December 2015

uart - Is this possible to transmit higher data-rate with 9600 bdrate clock in ISO7816


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:


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.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...