PN7120 interfacing with 8-Bit MCU Help on configutation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PN7120 interfacing with 8-Bit MCU Help on configutation

5,610 Views
n_chandrasekhar
Contributor I

Hello,

we are trying to build an NFC reader,we have choosen PN7120. in the Null os example, though it says the NXPNCI library works for both PN7150/PN7120 , the RF config table is missing..if we load same RF CONF for 1st gen PN7120,will it work. can u able to provide RF CONFIG values for  PN7120.

1. in code do we need to load all the config ? i.e

#define NXP_CORE_CONF                 0
#define NXP_CORE_CONF_EXTN        0
#define NXP_CORE_STANDBY         0
#define NXP_RF_CONF                         1

in the example, only RF_CONF is enabled...is it enough or do we need to load other ConF also?

still many doubts on the way ;-) ..Thank u

0 Kudos
16 Replies

1,649 Views
n_chandrasekhar
Contributor I

Hello,

Is no one who can help us on configuring PN7120 on this forum..i am observing that for some reason,NXP tech support is really poor, already 15days over after creating the post, yet no help..some one kindly help us. is there any way to reach NXP tech support via email...Thank u

0 Kudos

1,649 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello N. Chandra,

We are sorry for the delay to respond to your post.

Since you are porting the NCI stack to a different MCU then it is difficult to say what exactly is going wrong with your setup, but here are some considerations and suggestions.

- The RF Configuration is used to fine tune RF performance of a particular board and antenna. The config values you found are for the OM5578/PN7150 kit. I think the fine tuning step was not yet made for PN7120 board, so the values are missing. Since the board antenna is already matched anyway then it should be no big issue to omit the fine tuning. For a custom board you could read the appnote AN11564 PN7120 Antenna Design and Matching Guide from the Documentation tab:

PN7120 | Plug'n Play NFC Controller for OS Systems|NXP 

- As shown in the example project, before sending any commands to PN7120 it is recommended to reset it. This is done by pulling low the VEN pin as shown in a figure in the datasheet:

pastedImage_1.png

tw(VEN) is minimum 3 us while tboot is max 2.5 ms. The example project uses 10 ms for both.

- If you are confident the I2C communication works, the console log below shows the initialization sequence from the NXP NCI example. It shows the commands sent to PN7120 and the corresponding responses. If you have a logic analyzer at hand then you can compare your I2C frames to this log, considering only the payloads.

pastedImage_8.png

I hope this helps.

Regards!

Jorge Gonzalez

0 Kudos

1,649 Views
n_chandrasekhar
Contributor I

Hi Jorge,

Thank you, atleast now have some reply. we need your assistance & help to complete the project. Right now we were able to make some progress,and we have able to communicate with NFC card. but distance etc optimizations no done. right now we are facing a problem, right now in the example code, the controller waits in a loop,untill some card is detected. but we want to make it IRQ based. so,just in case if we move the same reading portion to IRQ_ISR, will it work?

we are expecting that when card reading starts, it provides data in full length of data in with out NCI fragmentation. but when the card reading takes place, we are seeing that, the NDEF data is cut into multiple packets and the some bytes are repeating... i am attaching the log,kindly analyse it and kindly help us,move further, to obtain the full NDEF message with out fragmentation.

pastedImage_2.png

Thank you waiting for your reply.if possible kindly share your Contact email,Thank you

with regards

Dr.N.Chandra sekhar,M.tech,phd

0 Kudos

1,649 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hi N. Chandra,

Could you let me know what kind of NFC card are you using?

Did you write NDEF data to the card yourselft (e.g. using Android app) or what data is in the card?

This would help me to analyze the communication frames.

PS. Sorry, I cannot share a contact email, but we can continue with the discussion here in community.

If you have sensitive or confidential information then there is also a support channel in (Sales and Support|NXP  -> Submit new tickets -> Hardware and software).

Regards!

Jorge Gonzalez

0 Kudos

1,649 Views
n_chandrasekhar
Contributor I

Hi Jorge,

Thanks for your reply. i am using NFC Sample Card supplied with NXP PN7120 evaluation kit. i have written 2 records using NXP android tool,

1. "hello this is mifare "

2."how many records " this were the records i have created on the card. i can see that in the line number 412 in abouve image "he" comes in the end,

in line number 415: "llo this is mifa"

in line number 418, & 421 contains remaining messages.

now problem is framing the data from the packets .. some times, as in circled,it is overlapping. as i understood NCI message supports 258bytes packets length, so how can i  get this as a single message till the length of 258bytes. also i can see the the packet fragmentation is not made as per seperate records also. it just dividing packets in lengths of 0x11.

the reason why i had asked for your contact mail ID is,just to get faster replies. as u know,i had created the post almost 20days back, and i got reply yesterday,so bit worried,what if each reply takes 20days :-)..thats it

Thank you

with regards

N.Chandra sekhar

0 Kudos

1,649 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Thank you for the details. So I guess your card is a MIFARE Ultralight EV1.

The NCI packet can indeed be 258 bytes long, but the fragmentation you see is a limitation of the Type 2 Tag READ command. Each command only returns 16 bytes. Subsequent READ commands must be sent if there is more data to read.

In your log above the NCI data packets starting with 00 00 02 30 XX are for reading the card's memory, where XX is the page number, each page containing 4 bytes. The packets with size 0x11 are the received data (16 data bytes + 1 status byte).

For this card in particular you could use the FAST_READ command to read more bytes at once. Just notice that this command is not available in all types of cards. Check the command details in the datasheet:

MF0ULx1

Regards!

Jorge Gonzalez

0 Kudos

1,649 Views
n_chandrasekhar
Contributor I

Hi Jorge,

how are you? waiting for your reply. Our requirement was to implement an NFC payment systems. after researching a lot, we came to know that some EMV card commands like

00A404000E315041592E5359532E4444463031 //Select 1PAY.SYS.DDF01 to get the PSE directory

has to be sent first and other steps has to be followed to read the visa paywave card details.,..but now in the library provided, we are finding difficulty to understand how to achieve this. we need your help and guidance .thank u

with regards

N.Chandra sekhar

0 Kudos

1,649 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hi N. Chandra,

The provided stack unfortunately does not include EMV examples for payment applications. For an application like this you need to get familiar with the EMV Contactless specifications, which are downloadable from the next link:

EMVCo 

Let me also ask internally if there are some guidelines right now for EMV using the PN7120. In case there is something I will let you know.

Regards!
Jorge Gonzalez

0 Kudos

1,649 Views
n_chandrasekhar
Contributor I

Hi jorge,

Any update about the EMVCo implementation example.

At greater difficulty,and lot of experimentation, i am able to make some progress with reading an Visa card., and i have altered the code in Type4 RW state machine.  .. I have a problem That, when even the card is not present ,the reader IC keeps sending the following error commands,

 RX 60 07 01 E4 --when NCI specification is checked it says, its an "CORE_GENERIC_ERROR_NTF"error and status code E4 is proprietary use
 RX 60 07 01 A1--  "CORE_GENERIC_ERROR_NTF" --> "DISCOVERY_TARGET_ACTIVATION_FAILED"

                    E4 error has started to appear only after enabling the EMVCo profile. when card is not even placed, or brought near, The "A1" error appears continously. How to solve this issue.Thank u

with regards

Dr.N.Chandra sekhar,M.tech,Phd.

0 Kudos

1,649 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hi Dr. N.Chandra,

Still checking internally on the EMVCo implementation. Please give me some more time.

Regarding the error codes:

- A1 is "DISCOVERY_TARGET_ACTIVATION_FAILED". This error could arise for example if a card is detected during polling loop but then the activation fails or if the card is removed before it can be activated succesfully.

- E4 is a NXP propietary status code (STATUS_EMVCO_PCD_COLLISION). See table below:

pastedImage_1.png

This status code is the result of an RF collision, when 2 or more cards are detected during the polling loop and it is continuously sent while cards are inside the RF field.

Regards!

Jorge Gonzalez

0 Kudos

1,649 Views
n_chandrasekhar
Contributor I

Hi Jorge,

Thanks for your prompt reply. Update me once u have any update about EMVCo application. mean while ,help me trouble shoot few issues, i think u are the right person who can help me. :-)

Regarding Error codes, i understood about it. but now my issue is, even when i hold the reader in mid air, no cards present even nearby 30 to 50cm range., in that case also , i am getting A1 & E4 errors continously , when i bring the card nearby, the error codes stops, then again it starts to appear.

Is it some how related to RX input resistor sensitivity? i am using 500ohms resistance, after EMC filter. when 1K resistors used, the reader not able to communicate with card, so added 1 more 1K in parallel. when 1K resistor used, not receive activity taken place, so no error codes received in that RX setting.

let me know,if there is something i need to check in hardware.thank u

with regards

N.Chandra sekhar

0 Kudos

1,649 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hi again Dr N. Chandra,

I thought you were using so far the OM5577/PN7120 board.

Are you using a custom board? If so then it could indeed be a hardware issue. The antenna design and matching is vital for a proper communication. There is an application note on this topic:

http://www.nxp.com/documents/application_note/AN11564.pdf 

I received some feedback regarding EMVCo implementation with PN7120. The experts actually discourage the use of PN7120 for payment applications. Please see below information:

----------------------------------------------------

PN7120 is not the most appropriate  IC for EMVco payment application.

Main reasons are:

- Digital protocol follows old version of specification and since FW is fixed there will be no update.

- No proof point demonstrate evidences to pass Analog certification with PN7120.

 

The dedicated products for such application are PN5180 and PN7462.

----------------------------------------------------

So you may consider using the PN5180 or PN7462. The software packages for both of these products include EMVCo example projects.

Regards!

Jorge Gonzalez

0 Kudos

1,649 Views
n_chandrasekhar
Contributor I

Hello Jorge,

thank u. yes we are using an Custom PCB. how ever the antenna is a pre-made antenna, we are using the following antennas,

1.www.mouser.com/pdfdocs/PulseW3580.pdf 

2.www.johansontechnology.com/datasheets/antennas/NFC1AT80A01N8.pdf

for first W3580 antenna we used the same matching circuit values mentioned in the datasheet. for other antenna, though we gone through the datasheet, we ended up with not able to find proper matching values.

these are the values we are using now for W3580

1.EMC Filter -560nH, 180pF

2. C1(series cap)- (33pf+18 pf)

3. C2(parallel)- (180pf+18pf)

4.Rq = 0ohms

5. Crx=1nf(connected at EMC filter)

6. Rrx=(500ohms)

right now we are using the same values for both  antennas. can you please kindly help us fine tune the matching circuit for NFC1AT80A01n8 antenna.

2.Regarding PN7120, we already made the wrong step in selection, and we are not in a position to go through entire design cycle. and our first version release date is already close. so we would like to roll out this version,with minimum batch, and as per your suggestions,we would switch to PN7642 or PN7632.

But for now,kindly help us reduce the "A1" & "E4" errors.

Thank you

with regards

N.Chandra sekhar

0 Kudos

1,649 Views
n_chandrasekhar
Contributor I

Hi Jorge,

Thank you for your reply. we have already gone through the EMV specs. but now problem is, we are confused about at which point the  EMV commands has to be sent. also when paypass card is placed,we didn't get any response. so we are stuck and our project dead line is already close. we need your help. we are relaying on your support only. Please kindly update if any examples. also just in case if any PN532 based libraries with EMV found, can it be helpful to use on PN7120

Thank u

0 Kudos

1,649 Views
n_chandrasekhar
Contributor I

Hi Jorge,

Thanks for your reply..i understood now,why it is fragmenting. our major application was to use this for NFC payments like Visa paywave,American express,mastercard etc. but we are finding difficulty in finding what type of cards are being used in such payment systems. after searching as lot on Web we found that, some cards like Mifare 1K classic cards are not supported universally. so we think that the cards used in payment systems might be some varients like  Ntag203,Ntag216,Ntag213,Topaz512 but not sure about it. Can you kindly help us identify which types of cards are used for Payment cards ,.Thank u

with regards

N.Chandra sekhar

0 Kudos

1,649 Views
n_chandrasekhar
Contributor I

Hi,

we were able to port code to 8-bit MCU..and was able to communicate with the chip, able to send & receive response..but now it waits in waiting for discovery for ever.,.even if card is placed, the the IRQ pin is not changing... we need some real quick help from NXP support engineers,who can help us in trouble shooting..we are finding difficulty to reach the right person who can help us. kindly some respond asap.Thank u

0 Kudos