Re: Using PN512 to communicate with Mifare Desfire EV1 card

Forum MIFARE SmartCard IC`s MIFARE DESFire Using PN512 to communicate with Mifare Desfire EV1 card Re: Using PN512 to communicate with Mifare Desfire EV1 card

Re: Using PN512 to communicate with Mifare Desfire EV1 card

4. April 2013 at 19:19
Dear Renke,

My code is:
void RATS(void)
{
PN512_Write(0x0A,0x80);
PN512_Write(0x09,0xE0);
PN512_Write(0x09,0x50); // Reader buffer size is 64 bytes (FIFO)
PN512_Write(0x12,0x80);
PN512_Write(0x13,0x80);
PN512_Write(0x0D,0x80);
//
PN512_Read(0x06);
PN512_Read(0x0A);
PN512_Read(0x09); // Read ATS
PN512_Read(0x09);
PN512_Read(0x09);
PN512_Read(0x09);
PN512_Read(0x09);
PN512_Read(0x09);
}
void PPS(void)
{
PN512_Write(0x0A,0x80);
PN512_Write(0x09,0xD0);
PN512_Write(0x09,0x11);
PN512_Write(0x09,0x00);
PN512_Write(0x12,0x80);
PN512_Write(0x13,0x80);
PN512_Write(0x0D,0x80);
//
PN512_Read(0x06);
PN512_Read(0x0A);
PN512_Read(0x09);
}
void AID_Select(void)
{
PN512_Write(0x0A,0x80);
PN512_Write(0x12,0x80); // Enable TX, RX CRC
PN512_Write(0x13,0x80);
PN512_Write(0x1D,0x00); // Enable parity
PN512_Write(0x09,0x5A); // Native select PICC
PN512_Write(0x09,0x00); // AID=000000
PN512_Write(0x09,0x00);
PN512_Write(0x09,0x00);
//
PN512_Write(0x01,0x0C); // Transceive
PN512_Write(0x0D,0x80); // Transmit
//
PN512_Read(0x06); // Status register
PN512_Read(0x0A); // FIFOLevel = 0x00 -> there is no anser from PICC, it should be 1
PN512_Read(0x09); // FIFO=0x77, It should be 0x00 (response of SelectApplication native command
}
void RFID_Desfire(void)
{
PN512_Config();
Mifare_REQA();
Mifare_ATQ();
Mifare_Anticoll_1();
Respond_SNR_1();
Mifare_Select_1();
Respond_SAK();
Mifare_Anticoll_2();
Respond_SNR_2();
Mifare_Select_2();
Respond_SAK();
RATS(); // E0 50
PPS(); // D0 11 00
delay_ms(100);
// all functions above are Ok
// only fail in this function, no response from PICC
AID_Select();
}

I've also simulated successfully by exchange of RD710 with all commands (functions) above. I can select the application and read out plain file data.
But with the same commands, PN512 can not select the application. There is no answer from PICC.

Do you think, I've missed some steps after RATS, PPS?

Best regards,
Trong Quyen
+ 0  |  - 0