How to configure Register (Configuration and Session) from RF Interface.

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

How to configure Register (Configuration and Session) from RF Interface.

3,020 Views
kfchoong
Contributor IV

Hi Sir / Madam,

I am developing NFC application using NXP NTAG 1K, datasheet NT3H1101/NT3H1201.pdf. 

When I am a Peer NFC device, may I know how can I read and write configuration register and session register from RF Interface ?  I am unable to find detail from the above datasheet.  

For read NXP NTAG Register (configuration and session) from RF interface:

Is it the same method as reading the mapped SRAM ?  in which we just need to read from the memory address. 0xF8, 0xF9, 0xE8, and 0xE9.

For write NXP NTAG Register (configuration and session) from RF interface:

Is it the same method as writing the mapped SRAM ?  in which we just need to write to the memory address. 0xF8, 0xF9, 0xE8, and 0xE9.

Or, is it we need to follow the method I2C interface read and write to its Configuration and Session Register ? If follow this way, may I know how to fill in the SA address ?

Lastly, may I know how can I modify the Register Lock bytes ?  It says that " Once set to 1b, cannot to reset to 0b anymore".  May I know what does this means ?  If I accidentally set to 1b, then how can I reset it back to 0b ?  Or the chip is consider scrapped ?

Thank you for your advice.

Please advice soon.

Cheers,

KF Choong

0 Kudos
17 Replies

1,959 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hi KF Choong,

I notice these are the same questions are in the last part of your other post:

https://community.nxp.com/message/836957 

Do you have doubts with regards to the provided responses?

About the timeout, this issue should be on the reader's side. Take 2 points in consideration:

- In the first part of the SECTOR SELECT command, the maximum TACK time is 10 ms as defined in the datasheet.

- For the second part, if the command is correct then the ACK is a "passive ACK", which means no reply at all. So the reader should not expect any response and a "timeout" should be considered as "ACK" or ignored.

Regards!

Jorge Gonzalez

0 Kudos

1,959 Views
kfchoong
Contributor IV

Hi Jorge Gonzalez,

Millions thanks for helping me.

First of all, I am sorry for taking too long to reply.  I was assign to another project which is more urgent and now back to NFC project.

May I ask, is the datasheet updated ?  For select sector command, I still unable to receive acknowledgement from NTAG 1K.  But, I can successfully select the correct sector without waiting for acknowledgement from NTAG 1K after send out first packet.  I have send packet 1 and 2 in one time and I am successfully select the sector I wanted.  Is this a reliable solution ? 

Thank you very much for your advice.

Cheers,

KF Choong

0 Kudos

1,959 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hi KF Choong,

NTAG responds with ACK to the first packet in SECTOR_SELECT command if the format including CRC is valid. If you do not see the ACK the issue should be from your reader side (e.g. the wait time is not enough).

The command will work reliably if both packets are formatted correctly, but it would be better if you dig in the reader's side to find why it is not catching the first ACK.

Regards!

Jorge Gonzalez

0 Kudos

1,959 Views
kfchoong
Contributor IV

Hi Jorge Gonzalez,

 

The wait time is 3 seconds.

 

 

Please advice.

 

Thank you.

 

 

Cheers,

KF Choong

0 Kudos

1,959 Views
kfchoong
Contributor IV

Hi Jorge Gonzalez,

Is my CRC correct ?  I am using this for all others functions and they all works well.

Please advice soon.

Thank you.

Cheers,

KF Choong 

0 Kudos

1,959 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hi KF Choong,

This is provided by the original software.

What software are you referring to?

CRC is a 2-bytes value calculated over each command frame. So it is strange that you would force the same CRC for all commands. For the first packet in SECTOR_SELECT command CRC would be 0x29 0x00.

Regards!

Jorge Gonzalez

0 Kudos

1,959 Views
kfchoong
Contributor IV

Hi Jorge Gonzalez,

May I know do I need RF field to be ON in order to read the Session Register ?

How about Configuration register ?  Do I need RF field to be ON in order to read the configuration register ?

Thank you.

Cheers,

KF Choong  

0 Kudos

1,959 Views
kfchoong
Contributor IV

What I meant is : To read from Peer NFC device.

Cheers,

KF Choong 

0 Kudos

1,959 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hi KF Choong,

Not sure If I understood. The RF Field is inherently ON when reading from a NFC device. No access to data (either read or write) from the NFC side is possible without the NFC Field.

Let me know if I misunderstood the question.

Regards!

Jorge Gonzalez

0 Kudos

1,959 Views
kfchoong
Contributor IV

Hi Jorge Gonzalez,

I encounter  a problem that during Type-A initialization, NXP NTAG 1K do not send back data to Peer NFC device.  Again, NXP NTAG 1K is timeout. 

The is when NXP NTAG 1K is in the IDLE state (refer to datasheet figure 5. RF communication principle of NTAG I2C).  Peer NFC device send an idling REQA (0x26, 0x07 , as given in ST code :  function int8_t ISO14443A_REQA( uint8_t *pDataRead )  )   to NXP NTAG 1K, but Peer NFC Device (ST95HF datasheet, page 79/93,  under ISO14443-A STARTING ANTICOLLISION ALGORITHM ) do not receive any data from NXP NTAG 1K.  Please advice.  Peer NFC device should expect  0x04  0x00 from NXP NATG 1K.  Therefore, initialization has fail.

Please advice soon.

Thank you very much.

Cheers,

KF Choong

0 Kudos

1,959 Views
kfchoong
Contributor IV

Hi Jorge Gonzalez,

The following is my post.  Would you please advice soon.  Thank you.

//*******************************************************************************************


How to Set and Reset I2C_LOCKED bit in NS_REG register inside Session Register, from I2C interface

Question asked by KF Choong on Nov 9, 2016

Like •
Show 0 Likes
0
Comment • 0

Hi Sir / Madam,

I encounter communication problem when NXP NTAG 1K communicate with peer NFC device.

My problem is I am not able to Set or Reset I2C_LOCKED bit in NS_REG register inside Session Register. From datasheet (NT3H1101/NT3H1201.pdf, page 27/65, Table 14), this bit can be Read and Write by I2C interface.

 

During peer NFC device(RF interface) has read the mirror SRAM in NXP NTAG 1K, NS_REG = 0xA9 or 0x29, NC_REG=0x7E.  For NS_REG = 0xA9, it means NDEF_DATA_READ = 1b, RF_LOCKED = 1b, SRAM_RF_READY=1b and RF_FIELD_PRESENT=1b. I can understand SRAM_RF_READY=1b because RF interface is read from Mirror SRAM, Not Mapped SRAM.  But, may I know why Memory is still lock to RF, as shown in RF_LOCKED = 1b ?  Doesn't it will change to RF_LOCKED = 0b and I2C_LOCKED = 1b ? Because RF interface has read the last page of Mirror SRAM Block, as this is correctly shown in NDEF_DATA_READ = 1b.

 

Is the above phenomena also caused by RF interface reading from Mirror SRAM, NOT Mapped SRAM ?  Then, may I know after RF interface has read the Mirrored SRAM, how I2C interface able to write data again ?

 

As an attempt to solve above problem, I have try to manually write 1b to I2C_LOCKED.  But I am not able to write on this bit although datasheet mention that this bit is R&W from I2 interface.

 

During this experiment and observation, RF field is stable and constantly provided. In addition, Pass through and its direction is maintained as shown in NC_REG=0x7E reading.  Also, RF is successfully reading on the correctly configure SRAM MIRROR BLOCK address.

 

 

Please advice soon.

 

 

Thank you very much for your help and advice.

 

 

Cheers,

KF Choong

Skype: ohchat12

0 Kudos

1,959 Views
kfchoong
Contributor IV

Hi Jorge Gonzalez,

Many thanks for you reply.  Yes, you have answer my question.

Would you please help me with my post which is 6 days ago ?  The title is :

How to Set and Reset I2C_LOCKED bit in NS_REG register inside Session Register, from I2C interface in NFC

Please advice soon.  Your advice is very much appreciated.

Thank you.

Cheers,

KF Choong

SkypeID: ohchat12 

0 Kudos

1,959 Views
kfchoong
Contributor IV

Hi Jorge Gonzalez,

I have try with sending 0xC2, 0xFF, 0x29 0x00 (CRC code you suggest) to NXP NTAG as first packet of Sector select command.

The result is the same, timeout error.

Thank you for your suggestion.

Please advice soon.

Cheers,

KF Choong

0 Kudos

1,959 Views
kfchoong
Contributor IV

Hi Jorge Gonzalez,

I am using ST microcontroller Cortex M3, for both NXP NTAG 1K and ST95HF.

Thank you.

Cheers,

KF Choong

0 Kudos

1,959 Views
kfchoong
Contributor IV

Hi Jorge Gonzalez,

Thank you very much for your help.

May I know the formula for calculating the CRC ?  So that I can include it inside my code, and then embedded it into my code before send o each command.

I have check out all other write command today and found out that they all do not have ACK send back from NXP NTAG 1K. The result is same as Sector Select command.   However, I have successful write to NXP NTAG 1K although I do not see ACK from my microcontroller.  However, I need to make clear this problem.

From microcontroller, I read it 3 times,  the values send back by attached NFC peripheral.

The results are:

1st read: 0x87, which indicate no tag or timeout.

2nd read: 0x01.

3rd read: 0x90, which indicate receive residual bit.

But, I have continue to read 10 times after the 3rd time.  Its all read 0x00s.

I am expecting the correct ACK receive from NXP NTAG 1K by Peer NFC device : 0x90, 0x04, 0x0A.

I think you might be correct that this is caused by Peer NFC device.  

 

Well, thanks again.  I also need your help on the following post 1 day ago. 

The title is :

How to Set and Reset I2C_LOCKED bit in NS_REG register inside Session Register, from I2C interface

Thank you Jorge.

Cheers,

KF Choong

SkypeID: ohchat12

0 Kudos

1,959 Views
kfchoong
Contributor IV

Hi Jorge Gonzalez,

Many thanks for your help.

I am using Peer NFC device ST95HF.  ST has provide driver for this communication.

Please advice soon.

Thank you.

Cheers,

KF Choong

SkypeID: ohchat12

0 Kudos

1,959 Views
kfchoong
Contributor IV

Hi Jorge Gonzalez,

I am sending the following packet 1 to NXP NTAG 1K :

#define PCDNFCT2_SECTOR_SEL 0xC2
#define SEND_MASK_APPENDCRC 0x20
#define SEND_MASK_8BITSINFIRSTBYTE 0x08

uint8_t sectorSelPacket1[] = {PCDNFCT2_SECTOR_SEL,0xFF,SEND_MASK_APPENDCRC|SEND_MASK_8BITSINFIRSTBYTE};

This is provided by the original software.

Please advice.

Thank you.

Cheers,

KF Choong

0 Kudos