I'm trying to implement a SIM card interface using TI TM4C123XL. I have a question about a clock. TI MCU seems to provide possibility to interface smart cards but don't let me multiply clock without multiplying baud rate. So it seems to me I will have to generate the clock using timer myself. So, how precise should a clock be? Should clock be synchronised with data? If so, how? What is its purpose?


1 Answer 1


First, everything is specified in ISO7816-3. You should really read it (I won't provide any links because the standard is not free, but you can still easily find it on the web). Now, regarding your specific questions:

Yes, you need to generate the clock that will be applied to the CLK pin. This clock does not need to be accurate. There is, however, a maximum and minimum value specified in the standard (1MHz min and 5MHz max - see chapter 5.2.3).

Yes, the clock needs to be synchronized with the data. At startup, there should be a ratio of 372 between the CLK frequency and the baud rate. Then, you can negociate higher speeds using the PPS protocol (this allows you to change this ratio, and also eventually use clock frequencies above 5MHz).

The original purpose of this clock was, basically, to be used as the main clock for the MCU. Smart cards were invented at a time when it was impractical to embed an internal oscillator within such a small MCU, so there had to be an external clock source. Now, most smart cards chips embed their own oscillator, because they can work at much higher speeds than the provided 1~5MHz clock, but the external clock is still used for synchronization of the communication (just because the standard requires it).

  • \$\begingroup\$ At first I couldn't find this specification, only the priced ones. A bit more research worked, however, thank you. \$\endgroup\$ Dec 6, 2016 at 8:42
  • \$\begingroup\$ @Artūras Jonkus: maybe this is a useful link: cardwerk.com/smartcards/smartcard_standard_ISO7816-3.aspx \$\endgroup\$
    – Curd
    Jan 26, 2017 at 17:07
  • 1
    \$\begingroup\$ I've already succesfully finished this project \$\endgroup\$ Jan 26, 2017 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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