Jump to content
43oh

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));
}

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...