Discussion in "Project Help" started by    scorcho    Oct 5, 2006.
Thu Oct 05 2006, 09:44 am
#1
Does anyone know if it's possible to emulate ISO7816 with a generic MCU UART interface. 7816 looks about the same as a generic 8p1 UART, so I'm wondering if this will work, and at what baud rate does 7816 work at? I look at some 7816-3 documents and they all mention ETU but don't mention the baudrate. Also, do any signals other than RX/TX need to be generated via GPIO pins?(clock, reset, etc)
Thu Oct 05 2006, 02:15 pm
#2
well i got some files for ya... check them out.. its a software implemented ISO 7816 for AT90S2313.. try reading it.





Thu Oct 05 2006, 02:17 pm
#3
i got this from
http://www.smartcache.net/download.html
here.. you can check it out.
Thu Oct 05 2006, 02:56 pm
#4
Thanks Rickey, I actually previously downloaded those files and took a look at them, but was largely confused as I'm not familiar with that MCU and there were function calls there specific to that MCU and I didn't know what they did exactly. What I'm looking for is a high level description of what needs to be done and tips on what to look out for, etc. After some researching I found out that the baud rate of ISO7816 is 9600baud and the clock needs to be between 1-5MHz, and usually is 3.58MHz to get the 9600baud. I'm wondering if it's possible to generate a clock that fast with a low cost MCU w/o it being entirely dedicated to generate the clock and doing nothing else. Also there's the problem of error detection, where the receiver(smart card) pulls the I/O pin low during the stop bits period upon detection of an error. The MCU needs to be able able to sense this and retransmit the byte again but I'm not sure how to sense that with regular UART. Any ideas?
Thu Oct 05 2006, 03:33 pm
#5
will look more for it..
Fri Oct 06 2006, 12:50 pm
#6
So after more researching, I have the following findings.

- The receiver and sender of an async serial interface such as UART need not and in many cases do not share the same clock. They must agree on a baudrate beforehand(9600bps for instance) for them to work.

If that's right, then I either have to provide a ~3.58MHz clock to the smart card that's derived from the MCU's system clock via timers out of a GPIO pin, or use an external 3.58MHz oscillator. This means that I will not use ISO7816's feature of frequency changing(is it even possible to disable this?)

- UART, being full duplex, has separate RX/TX signals, while ISO7816, being half duplex, only has a single I/O wire. Can I just wire them all together and disable RX bit when receiving and disable TX bit when receiving? Or must I use some kind of mux for this?

- The error detection part where the smart card pulls down the I/O during the guardtime(stop bits) is still a problem that I haven't found a solution to.
Fri Oct 06 2006, 04:33 pm
#7
i have read everything on 8052 also.. i was thinking regarding the half-duplex nature of 7816..
what you can do it.. while transmitting.. you can reset the REN bit of SMOD so while transmitting it will not recieve.. and.. before u come out.. make that bit set again.. hope that wil work and make it as half duplex..

-- regarding the error detection.. you can do one thing... like.. it wil be low for some ammount of time.. what if we make that time to.. 1 byte transmit time and.. then.. for pulling down the pin we can send 0x00 on the tx.. but... thats also a problem.. 0x00 and 0xff is reserverd i suppose..

i got this rfc document for 7816 check it out http://www.didya.com/7816.asp
Fri Oct 06 2006, 05:05 pm
#8
i think implementing everything in software wil be much better.. coz you can have full control over the pins.. so the error detection problem canbe removed easily i suppose.
Mon Oct 09 2006, 09:33 am
#9
I'm looking at my MCU's datasheet, especially the UART SFRs, and I realized that I don't see any bits to set the number of stop bits, UART mode(8bit), odd/even parity(even) and parity addition(disabled?). If this is so, does that mean I won't be able to emulate the low level ISO7816 UART?
Mon Oct 09 2006, 09:00 pm
#10
well i think on 8051 its hardly possible.. but in AVR people have implemented it.. i didnt get time to go through that code of 90S2313 but.. i realy wanna see what they have done.. have u seen the datashet of 90S2313? does it have Parity bit?
if it has.. then.. i think only 8051 with that option can be used otherwise NOT :/

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Bobbyerilar
Thu Mar 28 2024, 08:08 am
pb58
Thu Mar 28 2024, 05:54 am
Clarazkafup
Thu Mar 28 2024, 02:24 am
Walterkic
Thu Mar 28 2024, 01:19 am
Davidusawn
Wed Mar 27 2024, 08:30 pm
Richardsop
Tue Mar 26 2024, 10:33 pm
Stevencog
Tue Mar 26 2024, 04:26 pm
Bernardwarge
Tue Mar 26 2024, 11:15 am