Due I2C1 Line not working

Hi everyone,

Following I2C not working with SDA1 and SCL1 in an Arduino Due I generated some code to get the I2C1 line working for my project.

#include <Wire.h>
#define Wire Wire1

void setup() {
  // put your setup code here, to run once:
   Wire.begin();
   pinMode(5, OUTPUT);
   digitalWrite(5,1);
  //ire.setClock(3400000L);
}

void loop() {
  //Request Temp from the given Temp Sensor
  Wire.requestFrom(0x4A, 16);
  // Get the the Value
  int data = Wire.read();
  //Return the Value
  //return data;
  delay(1);
}

Whenever I comment out the #define Wire Wire1 everything works fine on the SCL and SDA lines. Is there something that I am missing to get this to work correctly on SCL1 and SDA1?

Pull-up resistors? It was mentioned in the topic that you linked.

I don't have a Due so I can't test.

From my reading of the Due's schematic, SCL0 and SDA0 have onboard pullups. SCL1 and SDA1 do not and so you will have to add your own.

Yeah I've tried a 7.5 k and 10 k Ohm pull up and neither of them fixed the issue. I look at the line on a scope and it seemed like it was creating some pulses put they were really slow and irregular.

I'd suggest starting with 4.7K and work down from there as far as 1.5K (that's what's on SCL0 and SDA0). For my taste 1.5K is too aggressive, but that's what whoever designed the board used so it might just need that.

Attempted to use a 1.5K and still not working correctly. The frequency for the SCL1 line is about 6 Hz compared to about 66 kHz for the SCL0

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.