First I would like to thank you, but I do not know how to answer you, since your kindness i would like to share opinions that maybe others can benefit from this topic.
API used for the get correct ATR answers from Smart Cards (ISO 7816 standard)
So I Need to build Application That I can Analyze Communication Protocols between Host and Card.
Okay So I attached partial Code that it may help you to understand what I am doing
Thanks Again.
'/******setting Parameters **************************/
DEFINE OSC 20 'LOCK 20 MHZs set HS in the configuration of the oscillator and to use pic from 20mhz!!!!!
DEFINE SER2_BITS 9 'bit datas included control prity
DEFINE I2C_SLOW 1 'lower velocity' it engages external eeprom (if clock> > 8 mhz)
DEFINE I2C_HOLD 1
adcon1=7 'set port.a all digital
d VAR BYTE
h VAR BYTE 'byte answered length Scard
d1 VAR BYTE 'first byte loop launches
d2 VAR BYTE 'last byte loop launches
scsdin VAR WORD 'parameter for serin2 toward deco
scsdou VAR WORD 'parameter for serout2 toward deco
scssin VAR WORD 'parameter for serin2 toward slave
scssou VAR WORD 'parameter for serout2 toward slave
dlatr VAR WORD 'parameter for calculation stand still among the first byte and following of the atr
'**********************************************
'*list of pin configuration Of PIC16876 I/SP *
'**********************************************
dio VAR PORTB.0 ' 0 data i/o with the Edec Edec << >> deco
'**********************************************
Data $3F,$FF,$11,$00,$01,$40,$96,$71,$71,$77,$0e,$6c,$b 6,$d6,$00,$01
Data $5a 'length command to be stopped in eeprom locals 32!!!!!!!! DON'T GO BEYOND 5a!!!!!!
Data $00,$01 'answered Data to Edec >> 00 01
Data $20,$51 '>>parameter for local serin2.35 from Edec >> $51-9600 bauds with 3,57 Mhz toward EDec (varying)
Data $20,$81
Read 35,scsdin.byte1 'it supports on tall byte of scsdin given in locals. 35 eeproms
Read 36,scsdin.byte0 'it supports on low byte of scsdin given in locals. 36 eeproms
Read 37,scssin.byte1 'it supports on tall byte of scssin given in locals. 37 eeproms
Read 38,scssin.byte0 'it supports on low byte of scssin given in locals. 38 eeproms
scsdou=scsdin+1 'serout2 verso Edeco=serin2+1
scssou=scssin+1 'serout2 verso master=serin2+1
dlatr=(scsdin.byte0*2) 'calculation break 3F of the atr compared to the baudrate
'I want to get reaply from the Eprom Data inverse mode ?????????
fase1: 'fase 1,validates atrs to the edec
d1=0 'first byte atr
d2=13 'last Byte atr
d=d1 'it sends only first byte atr to edec
Read d,h 'd=indicates eeprom invalid,h=data character character to be sent
SerOut2 dio,scsdou,[h] 'options driven,true,even for serout2---9600,8,e,1 >> 8274
PauseUs 80 'attend... .80.... ms' sends the other byte of the atr
Pause dlatr
Pause 140
For d=d1+1 to d2 'loop of 15 cycle, first byte atr to edec
Read d,h 'd=indicates eeprom inverse,h=data character character to be sent
SerOut2 dio,scsdou,[h] 'options driven,true,even for serout2---9600,8,e,1 >>
PauseUs 90
Bookmarks