Forum Replies Created

  • Re: Re: Using PN512 to communicate with Mifare Desfire EV1 card

    6. April 2013 at 7:49
    in reply to: Using PN512 to communicate with Mifare Desfire EV1 card
    Hi Renke,

    Thank for your help.
    Now, I can implement the SelectApplication function.
    I’ll need your more help about RFID, SAM AV1,2 on next time.
    Thank you once more time.

    Best regards,
    Trong Quyen
    + 0  |  - 0

    Re: Re: Using PN512 to communicate with Mifare Desfire EV1 card

    4. April 2013 at 19:19
    in reply to: Using PN512 to communicate with Mifare Desfire EV1 card
    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

    Re: Re: Using PN512 to communicate with Mifare Desfire EV1 card

    3. April 2013 at 8:39
    in reply to: Using PN512 to communicate with Mifare Desfire EV1 card
    Hi Renke,

    Thank for your feedback.
    I've used my embedded sytem PN512 to communicate with Desfire EV1 successfully with: REQA, CL1, CL2, RATS, PSS..
    It means that my config for PN512 is OK.
    However, I can not implement the native commands as: SelectApplication, GetVersion....
    My code is:
    void PICC_Select(void)
    {
    Write_PN512(0x0A,0x80); // Flush FIFO
    Write_PN512(0x09,0x5A); // Native command, select PICC
    Write_PN512(0x09,0x00);
    Write_PN512(0x09,0x00);
    Write_PN512(0x09,0x00);
    //
    Write_PN512(0x12,0x00); // Disable TX,RX CRC
    Write_PN512(0x13,0x00);
    Write_PN512(0x0D,0x80); // Transmit
    //
    Read_PN512(0x0A); // check response from PICC: get 0x00 -> It means there is no answer from PICC? It should be 1
    }

    Now, I'm using the native commands set of Desfire (MF3ICD40) instead of Desfire EV1 (MF3ICD41).
    Is it OK? I dont't find the native commands set of Desfire EV1 in Internet.
    Could you help me about the native commands set of Desfire EV1?

    Beas regards,
    Trong Quyen
    + 0  |  - 0
Viewing 3 posts - 1 through 3 (of 3 total)