Jump to content
curtis63

i2c has the SDA line held low

Recommended Posts

I'm attempting to get as close to an OpenCollector PIN as I can with the MSP430G2553 Launchpad and a sensor.  SCL is P1.6 and SDA is P1.7.  I digital write both pins LOW and then set the PinMode on both to INPUT which should allow both pins to float HIGH.
 
I have a 4.7K pullup resistor on each pin connecting it to 3.55v (HIGH).
 
Is my code wrong, or is the sensor that I'm using pulling the line low? 
 
The sensor says it operates at a max of 3.7 volts.  I'm using the Launchpad which measures 3.55v.  Am I overloading the sensor and causing it to pull SDA to low?
 
 
#define SDA P1_7
#define SCL P1_6
 
void setup()
{
  Serial.begin(9600);
  Serial.println("Starting...");
 
 
  digitalWrite(SDA, LOW);
  digitalWrite(SCL, LOW);
 
  pinMode(SDA, INPUT);
  pinMode(SCL, INPUT);
 
  delay(50);
 
  Serial.print("SDA pin - ");
  Serial.print(SDA);
  Serial.print(" - ");
  Serial.println(digitalRead(SDA));
  Serial.print("SCL pin - ");
  Serial.print(SCL);
  Serial.print(" - ");
  Serial.println(digitalRead(SCL));
}

 

Share this post


Link to post
Share on other sites

Hi Curtis,

tried your code with a Launchpad alone (and SCL & SDA made inputs + PULLUP) and the result is (as expected):

Starting...
SDA pin - 15 - 1
SCL pin - 14 - 1

The two J5 jumpers are OFF.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×