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 :
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):

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

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62