How to reliably activate pass-through mode for NXP I2C NTAG 2k

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

How to reliably activate pass-through mode for NXP I2C NTAG 2k

1,910 Views
xnormanw
Contributor II

Hey NXP-Forum,

thank you for your great support. I really appreciate your easy to understand and highly informative answers and I really hope I dont bother you too much asking another one for a better understanding of the NXP I2C Tag.

I'm currently trying to dynamically send data via I2C (Arduiono) to NTAG and receive it with my phone. Therefore, I'm trying to enable the pass-through mode. Here are my steps, which I follow to activate the pass through mode:

1. Config Registers FD_ON/FD_OFF both to 11b

2. While my phone is connected via NFC to the NTAG, I configure the NC_REG with my arduiono to 7B:

Byte 7 = 0

Byte 6 = Activate Pass Through to 1
Byte 54 = FD_OFF 11

Byte 32 = FD_ON 11

Byte 1 = 0

Byte 0 = 0  -> I2C TO RF

3. Afterwards, I see that pass through is activated on the Session Registers and try to write SRAM with the Arduino. Here some weird things usually happen. E.g. the ntag thinks its password protected, but neither any password, like sun or moon work to authentificate it. Only way to enable the NTAG again, is to remove the arduino from my PC.

Or I just cant write anything to the SRAM.

From there I also am not 100 % sure how to send the data to my phone // how to read the SRAM, either periodically or even once. I also once managed to configure the right things, write SRAM and waiting for it to be picked up, but I couldn't come any further. (See included picture, though I'm not sure which direction I tried to send/receive data there)

I'm really thankful for any help.

Best regards,

Norman

0 Kudos
5 Replies

1,734 Views
nxf58474
NXP Employee
NXP Employee

Hi Norman,

 

Hope you are doing well. The information related Pass is in the section 11.3 of the Data Sheet.

 

The first step is correct, to set the PTHRU_ON_OFF = 1b. Regarding your second step, 7B doesn't correspond to what you specify in the bits. 7B is:

7

 NFCS_I2C_RST_ON_OFF

0

 

6

PTHRU_ON_OFF

1

pass-through mode using SRAM enabled and SRAM mapped to end of Sector 0.

5-4

FD_OFF

11

(if FD_ON = 11b) if the field is switched off or if last data is read by I2C (in pass-through mode NFC ---> I2C) or last data is written by I2C (in pass-through mode I2C---> NFC)

3-2

 FD_ON

10

10b: by selection of the tag

1

SRAM_MIRROR_ON_ OFF

1

SRAM mirror enabled and mirrored SRAM starts at page SRAM_MIRROR_BLOCK

0

TRANSFER_DIR

1

from NFC to I2C interface

 

For your bits configuration, you need to write 7C to NC_REG.

 

I would recommend to check the section 4.2 of this Application Note, is about Data Transfer from I2C to NFC using Pass-Through Mode. There is a Communication scheme between the Reader (Smartphone), the NTAG I2C and a MCU.

 

Also there are some code examples for the NTAG I2C (plus) available in the SDK. You could download it from this page: SDK Builder.

 

There are some boards that include the examples in the middleware, for example if you download the FRDM-K64F SDK, you will find the NTAG I2C Middleware.

 

 pastedImage_6.png

In MCUXpresso you will be able to import the ntag_i2c_plus examples.

 pastedImage_7.png

 

 

Hope this helps. If you have any question please let me know.

 

Best Regards,

Ricardo

0 Kudos

1,735 Views
xnormanw
Contributor II

Hi Ricardo,

thanks for your reply, I'm doing fine, how about you?

Ricardo Zamora schrieb:

The first step is correct, to set the PTHRU_ON_OFF = 1b. Regarding your second step, 7B doesn't correspond to what you specify in the bits. 7B is:

Oh of course! Just a typo, I even described the correctly set bits and wrote the wrong hex-number. 

I would recommend to check the section 4.2 of this Application Note, is about Data Transfer from I2C to NFC using Pass-Through Mode. There is a Communication scheme between the Reader (Smartphone), the NTAG I2C and a MCU.

The Application Note was great and very informative, thanks!

However, I still struggle getting access to the NTAG. I write 16 pages of SRAM via Arduino (I2C) and afterwards, the I2C shouldn't be able to connect with the memory of the NTAG. After writing on the SRAM, my Arduino (I2C) waits till the state of the fd_pin changes and it can start writing the SRAM again.

But while it is waiting for a change to make, I cannot connect to the NXP I2C Tag plus via RF, since the NXP Tag is blocked, but neither I've blocked it, nor does any password unlock it.

0 Kudos

1,735 Views
nxf58474
NXP Employee
NXP Employee

Hi Norman,

 

If your NTAG I2C plus is apparently blocked, maybe you wrote to that registers unintentionally. One option to verify this is reading this registers to see if the tag was configured to have password protected areas.

 

pastedImage_2.png

 

And see if the values are different from the default values. (Table 10 of the Data Sheet).

 

Can you share the value of the registers?

 

Best regards,

Ricardo

0 Kudos

1,735 Views
xnormanw
Contributor II

Hello Ricardo,

since the NTAG cannot be accessed till I unplug it from the Arduino (or unplug the Arduino from the power source) I cannot gather any data. The problem is solved, after unplugging, but if it's suddenly password protected setting it up I cannot try out the pass-through mode.

Kind regards

Norman

0 Kudos

1,735 Views
nxf58474
NXP Employee
NXP Employee

Hi Norman,

 

How do you see that the NTAG is Password Protected? With the NTAG I2C Demo App? Can you share a screenshot?

 

Best regards,

Ricardo

0 Kudos