Summary of Contents for Silicon Laboratories EFM32
Page 1
Along with this document there is a working example of a smart card-reader, implemented using the EFM32. The included software example implements a USB-CCID card reader device using the STK3700 Giant Gecko Starter Kit. The software example is developed and tested with an ACS (Advanced Card Systems Ltd.) ACOS-1/3 type of...
The EFM32 microcontroller is used to implement a USB-enabled smart card reader and the included software example utilizes the EFM32 USART's 7816 smart card mode for automatic parity generation/check and ACK/NACK generation.
(typically a reader must support up to 5V, max 200mA draw, but the device implemented in this example only supports 3.3V since that is the operating voltage of the EFM32 on the STK3700 starter kit.)
And in the same way, the smart card can pull the line low, but needs the pull-up to take the line high again. Some interface-devices use more clever ways of doing this to achieve faster rise-times, but for the EFM32 implementation of the bi-directional data line the following configuration is used: Figure 2.2. Bi-directional Data Line with Pull-Up Resistor...
Page 5
...the world's most energy friendly microcontrollers The pull resistor used in the EFM32-implementation is the internal pull-up in the EFM32's GPIO pin. 2.2.2 Power Up, Clock and Reset When a card is inserted into the reader, all the contacts are disconnected from the terminal/reader, including ground.
(APDUs), which are exchanged between the reader application and the smart card application by the link-level protocol. Since only one type of the link-level protocol is supported by the EFM32-reader-implementation (T=0), this will be described in more detail than the others.
Page 7
...the world's most energy friendly microcontrollers Part 4 of the 7816 standard also defines a file system API to manipulate files and a security service API allowing smart card and reader to mutually authenticate with each other. This is not discussed further in this application note.
Page 8
...the world's most energy friendly microcontrollers • SW1: Status response of the current command. 0x90 means success for example. If this byte is equal to for instance 0x60=NULL or the INS sent in the command, it means the card need more time to process the command or that it has more data to receive/send.
Page 9
...the world's most energy friendly microcontrollers Figure 2.7. Parity Error and Re-transmission for the T=0 Protocol Sm art Card Sm art Card 7816- 3, T= 0 Protocol Term inal Parity Single Byte Error Retransm itted CLA INS Procedure byte DATA SW1 SW2 For further explanation of CLA the (class byte), INS (instruction) and P1-3 (parameters) and their contents in the T=0 protocol, please see the 7816 standard, (Reference 4 (p.
USB Host, which usually is a PC. Most of the protocol negotiation is also handled by the host. The EFM32's job is to act as a USB - smart card bridge, transferring data packets between the two and only handle T=0 protocol error conditions.
It is usually a normally closed switch, which opens when a smart card is inserted all the way in the socket. In this example it is connected to both EFM32 GND and a gpio-pin with a pull-up. When a card is inserted and the switch breaks the connection, it is expected that this pin is pulled up.
Since the firmware on the EFM32 itself is basically only shuffling data-packets back and forth between the smart card and the host computer, virtually any card supporting the correct speed and T=0 protocol should be able to communicate with the host computer.
Page 13
...the world's most energy friendly microcontrollers Figure 3.3. Card Detection and Notification Interrupt Card Inserted Usb- int: Notify Slot Change Handle USB- Wait for Card No Card m essages and Card Present CCID protocol Card Rem oved Usb- int: Notify Slot Change When one loop of the CCID_Handler is executed and the CCID either waits for a card or a card is present, it reads one incoming USB-message and takes the necessary action.
Page 14
...the world's most energy friendly microcontrollers Figure 3.4. Function Handling Command and Data Transfer with Smart Card Send Com m and Header (CLA, INS, P1- P3) Wait for Procedure Byte from Card If P- Byte = NULL (0x 60) If P- Byte = INS Send/ Receive Data to/ from Card Wait for...
CCID should take. See state-diagram in Figure 3.4 (p. 14) for how the send-APDU function is implemented in the EFM32-based CCID. If the procedure byte indicates that the smart card is ready to receive data, the CCID proceeds with sending the data to the smart card.
Page 16
...the world's most energy friendly microcontrollers Figure 3.6. Host Requests and Receives Data from Card EFM32 Sm art Card Host- PC CCID 7816- 3, T= 0 Protocol Reader CLA INS P1 CLA INS P1 Procedure byte DATA SW1 SW2 DATA SW1 SW2 3.4.3 Insertion and Removal of Card...
CCID should implement timeouts and error counters that signals the host with the appropriate messages in the event of a malfunction. The EFM32 CCID-implementation includes some simple error counters and timeout counters for this purpose, but it does not implement all the error conditions indicated in the USB-CCID standard.
...the world's most energy friendly microcontrollers Figure 3.8. SmartCache Application, result of "Get Info"-command From the command prompt in windows, one can also retrieve the "Answer to Reset" of the smart card by typing "certutil -scinfo". Figure 3.9. Windows Command Prompt with output from "certutil -scinfo" The screenshot above demonstrates use of the windows certutil function to read the smart card answer to reset.
Page 19
3.6.1 Adding a Level Translator and Protection Circuit When connecting the smart card directly to the EFM32, it will only support 3.3V cards, smart cards requiring 5V will not work when connected directly. Some cards need Vpp (programming voltage pin) to be set to a higher programming voltage when writing to the card.
...the world's most energy friendly microcontrollers 4 References 1. Universal Serial Bus Device Class: Smart Card CCID Specification for Integrated Circuit(s) Cards Interface Devices, Rev 1.1, 2005. http://www.usb.org/developers/devclass_docs/DWG_Smart-Card_CCID_Rev110.pdf 2. Online version of ISO 7816 Standard: http://www.cardwerk.com/smartcards/smartcard_standard_ISO7816.aspx 3. "Smart Cache" Windows software tool for storing data on ACOS-1/3 smart cards: http://www.smartcache.net/ 4.
A "Life Support System" is any product or system intended to support or sustain life and/or health, which, if it fails, can be reasonably expected to result in significant personal injury or death. Silicon Laboratories products are generally not intended for military applications. Silicon Laboratories products shall under no circumstances be used in weapons of mass destruction including (but not limited to) nuclear, biological or chemical weapons, or missiles capable of delivering such weapons.
...the world's most energy friendly microcontrollers B Contact Information Silicon Laboratories Inc. 400 West Cesar Chavez Austin, TX 78701 Please visit the Silicon Labs Technical Support web page: http://www.silabs.com/support/pages/contacttechnicalsupport.aspx and register to submit a technical support request. www.silabs.com 2014-01-23 - an0820_Rev1.00...
2.2. Part 3; Electrical Signal and Transmission Protocol ................4 2.3. Part 4; Commands and Exchange of Data Packets ................6 3. EFM32 USB CCID Implementation ......................10 3.1. USB CCID Standard ........................10 3.2. Connection of Smart Card to the STK ....................11 3.3.
Page 25
2.7. Parity Error and Re-transmission for the T=0 Protocol ................... 9 3.1. Smart Card USB CCID Device Class Standard ................... 10 3.2. Physical Connection of Card Socket with EFM32 Starterkit ................12 3.3. Card Detection and Notification Interrupt ....................13 3.4.
Page 26
...the world's most energy friendly microcontrollers List of Tables 2.1. Smart Card Electrical Connection ......................3 3.1. STK3700 Smart Card Pinout Description ....................11 www.silabs.com 2014-01-23 - an0820_Rev1.00...
Need help?
Do you have a question about the EFM32 and is the answer not in the manual?
Questions and answers