I'm having difficulties getting the second I2C channel working correctly.
Running the example code "I2C Digital Potentiometer" i got the expected result. (TWI_0.bmp logic analyzer screen cap)
i then modified it for channel 1 by changing "wire" to "wire1" with no success. (TWI_1.bmp logic analyzer screen cap)
// I2C Digital Potentiometer
// by Nicholas Zambetti <http://www.zambetti.com>
// and Shawn Bonkowski <http://people.interaction-ivrea.it/s.bonkowski/>
// Demonstrates use of the Wire library
// Controls AD5171 digital potentiometer via I2C/TWI
// Created 31 March 2006
// This example code is in the public domain.
// This example code is in the public domain.
#include <Wire.h>
void setup()
{
Wire1.begin(); // join i2c bus (address optional for master)
}
byte val = 0;
void loop()
{
Wire1.beginTransmission(44); // transmit to device #44 (0x2c)
// device address is 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 over from lowest value
}
delay(1);
}
SDA1 and SCL1 both have added 1K5 pull-up resistors.
Has anyone had a similar problem or have a suggestion to resolve this?
TWI_0.bmp (879 KB)
TWI_1.bmp (879 KB)