Feb 252011

Hmmmm. Kinda got distracted and didn’t post as much as I should’ve. Anyway, the next thing is an ISO-7816 smartcard interface based on the Arduino.

What is it?
This Arduino sketch lets you talk to some ISO-7816 smartcards that use the T=0 protocol at the usual baudrate and with the direct convention – in other words, quite a lot of them. In particular, it lets you speak to smartcards you’ve developed yourself using the open source SOSSE framework. It uses the same pinout as the Funcard programmer, so you can use the same hardware to program the cards with SOSSE as you do to communicate with them.

What’s the catch?
It only supports the T=0 protocol with direct convention, and only at one particular baud rate. It uses interrupts and timers in a very low-level way, which also means that you can’t easily change what pin is used for what. The protocol it uses to speak to the computer is oddball, and you need to write your own software to understand it… for now. It has very little intelligence, leaving the host PC to do most of the work.

Where do I get it from?
You can download it from here for now.

 Posted by at 7:50 pm

  2 Responses to “ISO-7816 smartcard interface for Arduino”

  1. hello!

    i connected my credit card to arduino, and i successfuly receive the ATR.
    The problem is that i receive the wrong response to any command that i send to the chip.
    i use the following code to send commands:

    uint8_t data[20] = { 0x00,0xA4,0x04,0x00,0x0E,0x31,0x50,0x41,0x59,0x2e,0x53,0x59,0x53,0x2e,0x44,0x44,0x46,0x30,0x31,0x00 };
    for(uint16_t i=0; i < 20; i++) {

    What is wrong?

    • You cant send such a long command.
      Send the first 5 bytes, wait for a reply (cant remember what it replies.. but it should be 1 byte) then send the remaining.
      Read the ISO7816 pdfs for more information.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>