M24SR64 and arduino I2C communication
hi using arduino uno board make application read data of m24sr64 antenna using i2c protocol. problem don't know if communicating it. know datasheet address read m24sr64 0xad.
here code of arduino uno can read data
#include <wire.h>
void setup()
{
serial.begin(9600);
wire.begin();
serial.println(eepromread());
}
void loop()
{
}
byte eepromread()
{
wire.begintransmission(0xad); // opens i2c communication m24sr64
wire.write(0);
wire.endtransmission();
wire.requestfrom(0xad, 1);
while(!wire.available())
{
}
return wire.read();
}
i have read in datasheet in order read ndef file have to send selectndeftagapplication command, select cc file, read cc file, select ndef file , read ndef file.
the problem here don't know how send commands using arduino , direction have send them. need interpret data datasheet.
i attach image of oscilloscope when update code above when arduino , m24sr64 connected , asked address 0xad 1 byte. can see 4 bytes being read. first 1 0xb4 , generated when begin transmission address 0xad, next 1 0 write command wire.write(0), next byte 0xb6 , generated command wire.requestfrom(0xad,1). , last byte byte asking in command wire.requestfrom(0xad,1). if may have asked 2 bytes, 2 0xff appear @ end of oscilloscope. don't know if communicating m24sr64 antenna data.
i thankful if me. job have summer company working with.
here code of arduino uno can read data
#include <wire.h>
void setup()
{
serial.begin(9600);
wire.begin();
serial.println(eepromread());
}
void loop()
{
}
byte eepromread()
{
wire.begintransmission(0xad); // opens i2c communication m24sr64
wire.write(0);
wire.endtransmission();
wire.requestfrom(0xad, 1);
while(!wire.available())
{
}
return wire.read();
}
i have read in datasheet in order read ndef file have to send selectndeftagapplication command, select cc file, read cc file, select ndef file , read ndef file.
the problem here don't know how send commands using arduino , direction have send them. need interpret data datasheet.
i attach image of oscilloscope when update code above when arduino , m24sr64 connected , asked address 0xad 1 byte. can see 4 bytes being read. first 1 0xb4 , generated when begin transmission address 0xad, next 1 0 write command wire.write(0), next byte 0xb6 , generated command wire.requestfrom(0xad,1). , last byte byte asking in command wire.requestfrom(0xad,1). if may have asked 2 bytes, 2 0xff appear @ end of oscilloscope. don't know if communicating m24sr64 antenna data.
i thankful if me. job have summer company working with.
you can read (german) blog https://regnerischernachmittag.wordpress.com/2014/08/22/m24sr-arduino-library/ how use m24sr. @ https://github.com/rena2019/arduinom24sr can find sources
Arduino Forum > Using Arduino > Networking, Protocols, and Devices (Moderator: fabioc84) > M24SR64 and arduino I2C communication
arduino
Comments
Post a Comment