Electronic Design

  
Reprints     Printer-Friendly    Email this Article    RSS        Font Size     What's This?


[Ideas For Design]
Drive Smart Cards With A Low-Cost MCU's UART

Carlos Cossio  |   ED Online ID #15147  |   March 29, 2007


The growing need for security and enhanced functionality in the banking, identification, and telecom markets has increased the use of smart cards worldwide, to the detriment of the low-security magnetic-stripe cards.

However, the development of the hardware and firmware needed for proper communications in a system based on a smart card poses new challenges to designers. Unfortunately, only some high-end microcontrollers have a dedicated UART (universal asynchronous receiver/transmitter) that can drive smart cards directly. The design described here, though, lets you drive a smart card using just the standard UART on a low-end 8-bit microcontroller, in this case an Atmel AVR ATmega 168.

Smart cards have just one communication path, labeled I/O, with the outside world, so it's used as a bidirectional signal to input and output data. This signal must line up with the UART's unidirectional reception and transmission signals RxD and TxD, respectively. Because RxD is an input signal and TxD is an output signal, a 1-kΩ resistor must be used to connect them to the smartcard I/O line to avoid line contention (see the figure).

On the firmware side, the design must implement a specific procedure for the reception and transmission of data to and from the smart card (see the code listing). On the one hand, to receive a byte from the smart card, the system must disable the UART's transmitter unit—again, to avoid line contention.

On the other hand, to transmit a byte to the smart card, the firmware must disable the UART's reception unit to avoid the reception of an echo character. Then it must wait until the end of the byte transmission to avoid false byte receptions. In this way, you can exchange information back and forth with the smart card using the T=0 protocol described in section 3 of the Smart Card Standard, ISO 7816-3, Electronic Signals and Transmission Protocols.

As an improvement—and to fully comply with the standard describing the smart-card communication protocols—the design must implement the parity error detection and re-transmission scheme defined in the ISO 7816-3 standard.


Reprints   Printer-Friendly  Email this Article  RSS    Font Size   What's This?


  • C Tools Accelerate HDV Development On Xilinx FPGAs
  • A New Design Inflection Point
  • Forecasting Industry Growth For 2009 And Beyond
  • EDA Retools To Exploit Multicore Architectures
  • Design And Verification Move Up In Abstraction
  • EDA Retools To Exploit Multicore Architectures
  • A New Design Inflection Point
  • Design And Verification Move Up In Abstraction
    1) Transportation Guidelines For Lithium Batteries Get Updated
    (1315 views today)
    2) Build A Smart Battery Charger Using A Single-Transistor Circuit
    (295 views today)
    3) WHITE PAPER: Liquid-Level Monitoring Using a Pressure Sensor
    (238 views today)
    4) 1-A Switching Regulators Operate With 96% Efficiency To Replace Linear Regulators
    (149 views today)
    5) The Field Of Energy Harvesting Begins To Ripen
    (115 views today)
    ALL TOP 20



    Reader Comments

    Why No source code: ED Online #15147 never appear?!!

    I had read the article in paper and it said the source code is in ED Online #15147.

    But here you don't have it at all!! Why?

    This is very unpresidented! I did see lots of code before. Why do you no longer place code?

    Guo-Yin Xu -April 17, 2007

    this site is very usful for students

    ramkumar -March 29, 2007

    POST YOUR COMMENTS HERE
    Name:

    Email:
    Your Comments:

    Enter the text from the image below


    Please refresh the page if you have trouble reading this text.

    Search Electronic Design
         
      
     
    Web Seminar
    Sponsored By:
    Title: Read Pacing: A Performance Enhancing Feature of PCI Express Gen 2 Switch Devices
    Speakers: 
    Date: 07/01/08
    Register: 

    Electronic Design Europe Electronic Design China EEPN Power Electronics Auto Electronics Microwaves & RF
    Mobile Dev & Design Schematics Find Power Products Military Electronics EE Events Related Resources