Arduino Due TWI/I2C channel 1
i'm having difficulties getting second i2c channel working correctly.
running example code "i2c digital potentiometer" got expected result. (twi_0.bmp logic analyzer screen cap)
i modified it channel 1 changing "wire" "wire1" no success. (twi_1.bmp logic analyzer screen cap)
sda1 , scl1 both have added 1k5 pull-up resistors.
has had similar problem or have suggestion resolve this?
running example code "i2c digital potentiometer" got expected result. (twi_0.bmp logic analyzer screen cap)
i modified it channel 1 changing "wire" "wire1" no success. (twi_1.bmp logic analyzer screen cap)
code: [select]
// i2c digital potentiometer
// nicholas zambetti <http://www.zambetti.com>
// , shawn bonkowski <http://people.interaction-ivrea.it/s.bonkowski/>
// demonstrates use of wire library
// controls ad5171 digital potentiometer via i2c/twi
// created 31 march 2006
// example code in public domain.
// example code in public domain.
#include <wire.h>
void setup()
{
wire1.begin(); // join i2c bus (address optional master)
}
byte val = 0;
void loop()
{
wire1.begintransmission(44); // transmit device #44 (0x2c)
// device address specified in datasheet
wire1.write(byte(0x00)); // sends instruction byte
wire1.write(val); // sends potentiometer value byte
wire1.endtransmission(); // stop transmitting
val++; // increment value
if(val == 64) // if reached 64th position (max)
{
val = 0; // start on lowest value
}
delay(1);
}
sda1 , scl1 both have added 1k5 pull-up resistors.
has had similar problem or have suggestion resolve this?
hello silen1985,
the whole due's twi code ok , handles both i2c peripherals (twi/twi1). imho, issue should related hardware. i'd recommend use different pull value 10k. regards,
p
the whole due's twi code ok , handles both i2c peripherals (twi/twi1). imho, issue should related hardware. i'd recommend use different pull value 10k. regards,
p
Arduino Forum > Products > Arduino Due (Moderator: fabioc84) > Arduino Due TWI/I2C channel 1
arduino
Comments
Post a Comment