AnsweredAssumed Answered

M24Sr02 Read and Write Problem(I2C)

Question asked by Anish Venkataraman on Jun 21, 2018
Latest reply on Jun 25, 2018 by Anish Venkataraman

Hello Everyone!

 

I am currently using the dynmaic nfc tag M24SR02-Y and I am facing problems with it while communicating with I2C. I get all the correct responses but when i try to read the NDEF length something goes wrong. I would appreciate if someone could help me out with this issue, I have been coding it for 2 days now and nothing seems to work.

 

Here are my commands with Responses:

//Send "Kill RF and open I2C
  Send AC 52

 

  //Select NFC-T4
  AC 02 00 A4 04 00 07 D2 76 00 00 85 01 01 00 CRC CRC
  //Read back answer from M24SR
  Write AD, READ 02 90 00 CRC CRC 
  
  // select CC
  AC 03 00 A4 00 0C 02 E1 03 CRC CRC
  //Read back answer from M24SR
  Write AD Read 03 90 00 CRC CRC
  
  //Read CC file-length
  AC 02 00 B0 00 00 02 CRC CRC
  //Read back answer from M24SR
  Write AD Read 02 00 0F 90 00 CRC CRC 

 

  //Read CC file
  AC 03 00 B0 00 00 0F CRC CRC
  //Read back answer from M24SR
  Write AD Read 03 00 0F 20 00 F6 00 F6 04 06 00 01 01 00 00 00 90 00 CRC CRC

 

Write commands

 

 //Select NDEF file
  AC 02 00 A4 00 0C 02 00 01 CRC CRC 
  Write AD Read 02 90 00 CRC CRC 
  
  //Erase NDEF message length
  AC 02 00 A4 00 0C 02 00 01 CRC CRC 
  Write AD Read 03 90 00
  
  //Write NDEF message

Wrote AC 02 00 D6 00 02 0D D1 01 09 54 02 65 6E 4E 69 63 6B 65 21 21 CRC CRC

Read 03 09 00 CRC CRC

 

//Write NDEF length

AC 03 00 D6 00 00 02 00 0E CRC CRC
  Write AD Read 02 90 00 CRC CRC

 

//Deselect command

AC C2 CRC CRC

 

when i remove supply and place my phone on top of the antenna the tag reads 0 bytes/255. What am I doing wrong?

 

To verify the write was successful I added  read commands as well.

 

Read Commands 

 

//Select NDEF file
  AC 02 00 A4 00 0C 02 00 01 CRC CRC
  //Read back answer from M24SR
  Write AD Read 02 90 00 CRC CRC 
  
  //Read NDEF message length
  AC 03 00 B0 00 00 02 CRC CRC 
  Write AD Read 03 00 0f 90 00 44 45 Similar to the response of CC file length but length shows "0x0f" whereas written is 0E 
and when I try to read the data it is similar to contents of CC file. Please help me.

 

Thanks in advance.

Outcomes