How to emulate a card using ACR122U-A9

I have an ACR122U-A9, I want the card to emulate it. I ask who did it? Can you give me some suggestions?

Now I have other problems as well, when I put a white smart card on this NFC reader, the LED only blinks once. But when I press the phone on it, the LED always blinks until the phone goes out.

+3


source to share


2 answers


The ACR122U contains a PN532 NFC controller chip. PN532 supports host emulation via command TgInitAsTarget

(see PN532 user manual ). To send PN532 commands, you must connect to the ACR122U in the same way as if it were a regular smart card reader (for example using a PC / SC). Then you can send PN532 packet commands to APDU reading forms

> FF000000 <Lc> <Command>

      

and get answers in the form



< <Response> 9000

      

So, to turn the ACR122 into card emulation mode, you will do the following:

  • ReadRegister:

    > FF000000 08 D406 6305 630D 6338
    < D507 xx yy zz 9000
    
          

  • Update register values:

    xx = xx | 0x004;  // CIU_TxAuto |= InitialRFOn
    yy = yy & 0x0EF;  // CIU_ManualRCV &= ~ParityDisable
    zz = zz & 0x0F7;  // CIU_Status2 &= ~MFCrypto1On
    
          

  • WriteRegister:

    > FF000000 11 D408 6302 80 6303 80 6305 xx 630D yy 6338 zz
    < D509 9000
    
          

  • SetParameters:

    > FF000000 03 D412 30
    < D513 9000
    
          

  • TgInitAsTarget

    > FF000000 27 D48C 05 0400 123456 20 000000000000000000000000000000000000 00000000000000000000 00 00
    < D58D xx ... 9000
    
          

    Where xx

    should be equal to 0x08.

  • Communicate using the TgGetData and TgSetData command sequence:

    > FF000000 02 D486
    < D587 xx <C-APDU> 9000
    
          

    Where xx

    is the status code (must be 0x00

    for success) and C-APDU is the command sent from the reader.

    > FF000000 yy D48E <R-APDU>
    < D587 xx 9000
    
          

    Where yy

    is 2 + R-APDU length (response) and xx

    is the status code (must be 0x00

    for success).

+1


source


Basically, the ACR122U is not designed to emulate a card, although the manufacturer still has very little information on whether it can be used to emulate an NFC card. If possible, it won't be so straight forward. I suggest you try Android host card emulation (HCE on Android 4.4).



For part 2: I tried with my phone (Xperia Z), when I turned on the NFC chip and placed the phone through the card reader, nothing happened on both sides. You may be using the phone card emulation feature.

+1


source







All Articles