I2C speed on Arduino DUE
hi!
i'm trying connect pressure sensor arduino due, using i2c. sensor in 5v, i'm using logic level converter sparkfun. i've add 2*2 pull'up resistors, on each side of level converter.
using arduino uno in 5v, 2 pull resistors, works perfectly.
using due, same sketch, first reading correct, after , readings second byte copy of first one, not correct. suspect problem of speed ? on due how can change speed ? i've twi.c or .h file can't find speed.
here part of sketch :
thx help
i'm trying connect pressure sensor arduino due, using i2c. sensor in 5v, i'm using logic level converter sparkfun. i've add 2*2 pull'up resistors, on each side of level converter.
using arduino uno in 5v, 2 pull resistors, works perfectly.
using due, same sketch, first reading correct, after , readings second byte copy of first one, not correct. suspect problem of speed ? on due how can change speed ? i've twi.c or .h file can't find speed.
here part of sketch :
code: [select]
wire.requestfrom(0x28, 2);
while(wire.available())
{
v1 = wire.read();
v2 = wire.read();
}
serial.println(v1);
serial.println(v2);
thx help
the speed of i2c fixed on due (at least if use wire library):
and
so doubt speed problem here.
check return value of wire.requestfrom() if read requested number of bytes.
if doesn't help: post whole sketch!
code: [select]
twi_configuremaster(twi, twi_clock, variant_mck);
and
code: [select]
static const uint32_t twi_clock = 100000;
so doubt speed problem here.
check return value of wire.requestfrom() if read requested number of bytes.
if doesn't help: post whole sketch!
Arduino Forum > Using Arduino > Networking, Protocols, and Devices (Moderator: fabioc84) > I2C speed on Arduino DUE
arduino
Comments
Post a Comment