cancel
Showing results for 
Search instead for 
Did you mean: 

M24SR64 and Arduino

eduardo
Associate II
Posted on June 12, 2014 at 18:55

Hi I am using an Arduino UNO board to make an application to read the data of my M24SR64 antenna using I2C protocol. The problem is that I don't know if I am already communicating with it. I know from the datasheet that the address to read from a M24SR64 is 0xAD.

Here is the code of the Arduino UNO so I can read the data

&sharpinclude <Wire.h>

void setup()

{  

  Serial.begin(9600);

  

   Wire.begin();  

   

   Serial.println(eepromRead());

   

}

void loop()

{

}

byte eepromRead()

{

  Wire.beginTransmission(0xAD); // Opens I2C communication with M24SR64

  Wire.write(0);

  Wire.endTransmission();

  

  Wire.requestFrom(0xAD, 1);

  

  while(!Wire.available())

  {    

  }

  return Wire.read();

}

I have also read in the datasheet that in order to read an NDEF file I have to  Send the SelectNDEFTagApplication command, Select the CC file, Read the CC file, Select the NDEF file and Read the NDEF file. 

The problem here is that I don't know how to send all those commands using the Arduino and to which direction I have to send them. I really need help to interpret some data from the datasheet. 

I also attach an image of the oscilloscope when I update the code above when the Arduino and the M24SR64 are connected and I asked from the address 0xAD 1 byte. You can see that 4 bytes are being read. The first one is a 0xB4 and it is generated when I begin the transmission with address 0xAD, the next one is the zero I write with the command Wire.Write(0), the next byte is a 0xB6 and it is generated with the command Wire.requestFrom(0xAD,1). And the last byte it is the byte that I am asking for in the command Wire.requestFrom(0xAD,1). If I may have asked for 2 bytes, then 2 0xFF would appear at the end of the oscilloscope. I don't know if I am already communicating with the M24SR64 antenna with those data.

I would be very thankful if you could help me. This is for a job I have to do this summer for the company I am working with.

#arduino #m24sr
1 ACCEPTED SOLUTION

Accepted Solutions
Anais GALLIGANI
Senior II
Posted on June 30, 2015 at 13:52

Hi ,

Have you tried with the Nucleo board X-NUCLEO-NFC01A1 that is powered through Arduino UNO R3 connectors?

plus we are providing firmware

http://www.st.com/web/en/catalog/tools/PF259178

 & the STM32 Cube expansion SW

http://www.st.com/web/en/catalog/tools/PF261463

 

I hope this is helping,

Have a nice day,

All the best,

ST NFC/RFID support

View solution in original post

7 REPLIES 7
awong1900
Associate II
Posted on June 16, 2014 at 04:50

Hi, 0690X0000060MoPQAU.gif

I also do this with arduino.

I use#define M24SR_ADDR 0x56 /*!< M24SR address 7-bit*/

It works.

And I think the UNO's SRAM is not enough for ST NFC tag.

Thanks

Ten

eduardo
Associate II
Posted on June 16, 2014 at 21:23

awong1900
Associate II
Posted on June 17, 2014 at 03:25

Hi, 0690X0000060MoQQAU.gif

Yes, If the SRAM is not enough. UNO will crash.

I use 2560 to test.

You can find the I2C address with I2C_scanner.

The code here:http://playground.arduino.cc/Main/I2cScanner

Ten

eduardo
Associate II
Posted on June 18, 2014 at 22:09

awong1900
Associate II
Posted on June 20, 2014 at 03:12

Hi Eduardo,

Yes, use 0x56 is correct in Arduino.

You can refer to stsw-m24sr001 on

http://www.st.com/stonline/stappl/productcatalog/app?page=partNumberSearchPage&levelid=SS1812&parentid=1871&resourcetype=SW.

I also porting the code recently.

Ten
giovanni23
Associate
Posted on January 27, 2015 at 18:20

Hi aguilera.eduardo,

did you  finally find a solution? I'm in the same situation but still trying to communicate with an NFC/RFID card using Arduino UNO and M24SR64 antenna.

Using I2C scanner M24SR64 reply with 0x2D and 0x56 addresses.

could anyone help me? thanks

Anais GALLIGANI
Senior II
Posted on June 30, 2015 at 13:52

Hi ,

Have you tried with the Nucleo board X-NUCLEO-NFC01A1 that is powered through Arduino UNO R3 connectors?

plus we are providing firmware

http://www.st.com/web/en/catalog/tools/PF259178

 & the STM32 Cube expansion SW

http://www.st.com/web/en/catalog/tools/PF261463

 

I hope this is helping,

Have a nice day,

All the best,

ST NFC/RFID support