Filling I2C command bytes for NTAG 5

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

Filling I2C command bytes for NTAG 5

Jump to solution
2,289 Views
PK2021
Contributor II

I am using the OM2NTP5332 evaluation board which has NTA5332 device on it. Using the LPCXpresso LPC11U37H board and NTAG5_I2C_Cockpit_v1.1 software I am able to read the configuration registers. The following are some of the examples:

> Reading configuration register I2C_SLAVE_CONFIG:

I2C>> S A8 10 3E P

I2C>> S A9 54 00 09 02 P

> Reading configuration register EHCONFIG:

I2C>> S A8 10 3D P

I2C>> S A9 00 00 00 00 P

> Reading configuration register EDCONFIG:

I2C>> S A8 10 3D P

I2C>> S A9 00 00 00 00 P

> Writing configuration register EHCONFIG:

I2C>> S A8 10 3D P

I2C>> S A9 00 00 00 00 P

I2C>> S A8 10 3D 01 00 00 00 P

> Reading configuration register EHCONFIG:

I2C>> S A8 10 3D P

I2C>> S A9 01 00 00 00 P

 

In first case above, it appears that the command being issued is “A8 10 3E”, and the reply to that is “A9 54 00 09 02”. Reading the document “NTP53x2 – NTAG 5 link – NFC Forum-compliant I2C bridge”, I know that “10 3E” is the block address over I2C for I2C_SLAVE_CONFIG.

I have the following questions:

  1. What is “A8” byte in the above sequence – “A8 10 3E”?
  2. I have a custom board where the NTA5332 is connected over I2C to a Microcontroller which acts as the master on I2C bus. I want to issue the ‘READ CONFIGURATION’ command over I2C from my microcontroller code. How do I fill the byte command stream?

 

I see that the READ CONFIG request format, as given in Table 115 in the above document is as follows:

Flags

READ CONFIG

Manuf. Code

UID

Block Address

Number of Blocks

CRC16

8 bits

8 bits

8 bits

64 bits

(optional)

8 bits

8 bits

16 bits

 

The only fields I know how to fill are as follows:

Flags

READ CONFIG

Manuf. Code

UID

Block Address

Number of Blocks

CRC16

 

0xC0

0x4

 

 

0

 

 

  1. What byte value do I put in Flags field?
  2. Since the UID is optional, can I remove it altogether?
  3. Block Address – I think should be “10 3E”, but the room for Block Address is only 8 bits, not 16. What do I do?
  4. Does the CRC16 value field contain the calculated value from the byte stream consisting of “Flags, READ CONFIG, Manuf. Code, UID, Block Address and the Number of Blocks?”
  5. What formula is used to calculate CRC16?

 

  1. From the Cockpit App output above, it appears that the output display is showing only the partial values that it sends over I2C to the NTAG board. Is there a way to see the full stream for a single command, e.g., READ CONFIGURATION?
  2. Could you give me a complete example of  READ CONFIGURATION or any other command in terms of what values are filled in which field? This would be the command being sent over I2C to the NTA5332 slave device.

Thank you in advance for your answers!

0 Kudos
1 Solution
2,102 Views
Fabian_R
NXP TechSupport
NXP TechSupport

I hope you are doing fine, as you say A8 in binary is 1010 1000, in the I2C protocol is mentioned that the 8 bit will indicate if either the frame is a read or a write command.

The last bit in 1010 100[0] indicates write, if the sequence is 1010 100[1] this indicates read. This is why you are watching it change from A8 to A9 depending on the command type in the log.

Best Regards,
Fabian

View solution in original post

6 Replies
615 Views
kkla203
Contributor I

so the slave address register for ntag 5 om2ntp5332 is A8/9 or the default 0x00

0 Kudos
2,243 Views
Fabian_R
NXP TechSupport
NXP TechSupport

Thank you for using our community to answer your questions, we really appreciate it!

I believe that there might be a confusion with the functionality of the NTAG 5, this device has 2 separate interfaces, NFC and I2C.

What you are watching in the Cockpit are the readings from the I2C interface. And the frame from table 115 is for NFC interface.

In order to use the I2C interface with your MCU, please check section 8.3 from the Datasheet. As mentioned in section 8.3.1, the definition is well explained in  UM10204. By following this User Manual, you won't have issues implementing the i2c communication with any MCU.

There is an Application Note that might help you understand the implementation of the I2C although it is an I2C master example from the NTAG 5 side, could it be useful for your project.

There is also a series of tutorials from Mobile Knowledge that could be useful for getting started in the development of a solution using NTAG 5.

 

I hope this information may have been useful!

Best Regards,
Fabian
0 Kudos
2,207 Views
PK2021
Contributor II

Thanks for clearing my confusion between I2C and NFC and for sending the links to other useful information.

However, I am still not clear about my question 1.  What is “A8” byte in the above sequence – “A8 10 3E”?

Hoping for a fast reply. Thanks.

0 Kudos
2,172 Views
Fabian_R
NXP TechSupport
NXP TechSupport

Please take a look at Figure 22. of UM11406, where a Log window is shown. A8 changes to A9 because as mentioned earlier, it is a 7-bit I2C address that changes its last bit to 1 or 0 depending on if the instruction sent by I2C is for Read or Write.

Please check UM10204 for the full explanation about this matter.

Best Regards,
Fabian
0 Kudos
2,160 Views
PK2021
Contributor II

That's what I am confused about! "A8h" in binary is "1010 1000", which clearly occupies 8 bits. So, what is this number representing in this sequence?

Thanks for your support.

0 Kudos
2,103 Views
Fabian_R
NXP TechSupport
NXP TechSupport

I hope you are doing fine, as you say A8 in binary is 1010 1000, in the I2C protocol is mentioned that the 8 bit will indicate if either the frame is a read or a write command.

The last bit in 1010 100[0] indicates write, if the sequence is 1010 100[1] this indicates read. This is why you are watching it change from A8 to A9 depending on the command type in the log.

Best Regards,
Fabian