Main Site Documentation

FEZ Spider to smartcard


#1

I am fairly new to embedded development and am trying to learn some things on my own but I seem to be stuck.

I have a FEZ Spider and am trying to communicate with a smartcard. I have a smartcard breakout board wired up to a gadgeteer breakout module. As far as I understand, I can use TWI or Serial to communicate with the smartcard. I would like to use serial, as I feel it will better fit my application.

My first issue is I’m not 100% sure how to wire the smartcard breakout to the breakout module. Serial uses one pin for Tx and one for Rx, but the smart card has one bidirectional I/O pin. I’ve read that I am supposed to short the two pins together but I couldn’t get that to work either.

My second issue is in the code, what do I need to do for the smartcard’s reset pin.

If I could get some assistance on this that would be great!


#2

Welcome to the forum!

For people to help you better, can you provide a link to smartcard/breakout board?


#3

Thanks for the reply.

The breakout board I’m using is this one: https://www.sparkfun.com/products/retired/9440
And the smartcard is an Atmel AT88SC0404C. I have the datasheet for the smartcard as well if that helps.


#4

I forgot new users to the forum can’t post … but quoting it shows it.

http://www.atmel.com/Images/doc2023s.pdf

This isn’t my forte, but it looks to be a I2C bus, aka 2 wire serial.


#5

Ah, sorry about that.

If I understand correctly, the smartcard can be communicated with using I2C or serial using a UART. The major issue i have is how to wire it up correctly. I can likely figure out majority of the code once I know I have it wired properly. Like I said the only software issue I can foresee is what to do with the reset wire.

I have an example of someone doing something similar with the same card and they said they needed to use a 9600 baud UART with 8 data bits, even parity,and one stop bit, which sounds like serial to me. But unfortunately I don’t have any more information than that.


#6

where’s the reference of someone else’s attempts? Those often shed the most light on the problem/solution


#7

http://www.smartcardsupply.com/Content/Cards/7816standard.htm

Does this help?


#8

So the Atmel datasheet is probably the best help here. And I would first ignore UART mode (I doubt it’ll work, it’s never mentioned in the datasheet) and use I2C. There is no difference in code once you have it working, so I can’t see much benefit in seeking UARTs.

From a wiring perspective, you need SCL and SDA from the I2C pins (open drain with pullups - that’s an I socket). You also need a GPIO for RST (which appears to be an output from the smartcard, not something to reset the smartcard). Also, strangely, it seems there’s no CS line meaning you can’t really share the I2C bus. Then you need the obligatory GND and 3v3 (VCC) lines.


#9

This is the example I am working from. I saw it and it intruiged me. I graduated from a software engineering course but we didn’t do as much practical embedded development as I would have liked, and I happen to have access to this system. www. youtube .com/watch?v=lucp2isxpAc (no spaces)

In the datasheet it shows ISO and TWI smart card modules. From what I can tell they used the ISO one. From reading the datasheet it appears that the ISO is asynchronous an TWI is synchronous (correct me if I’m wrong).

For the reset, the link njbuch provided it says

[quote]b - Reset of the card:

A card reset is initiated by the interface device, whereupon the card
shall respond with an Answer to Reset as describe in 2.4.[/quote]

which leads me to believe the host supplies the reset, not the card.


#10

I really appreciate the help so far but any thoughts on how to proceed?

I can’t be the only one that’s tried something like this. Can I?


#11

yes, yes you can. Here at least !

how has your I2C testing worked out??