This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F5529: I2C not working with Energia

Part Number: MSP430F5529
Other Parts Discussed in Thread: ENERGIA

Feels like this should be a pretty easy problem to solve but it's giving me a headache. 

I have an MSP430F5529 launchpad with 7.5kohm resistors being used as pullups from 3V3. When I run the code and connect SDA and SCL directly to an oscilloscope, both SDA and SCL are held high.

I already found out that Wire.endTransmission() causes a hold up in the code so I commented it out. Also, when I leave in all the serial.print commands I can see based on the monitor that it is looping through the loop().

#include <Wire.h>

byte idle = 0x00; // Tidle min = 4 clk pulses but can be longer

byte Start =  0x05;
byte TIDhigh =  0x02;
byte TIDlow = 0x03;
byte CNTL =  0x7D;
byte CPTY =  1;
byte D1;
byte D2;

void setup() {
  
  Serial.begin(9600);           // start serial for output
  delay(100);
  Wire.begin();

}

void loop() {

  DataFormation();

/*
  Serial.print("D1: ");
  Serial.print(D1, HEX);
  Serial.print("\n");

  Serial.print("Start: ");
  Serial.print(Start, HEX);
  Serial.print("\n");

  Serial.print("TID: ");
  Serial.print(TIDlow, HEX);
  Serial.print("\n");

  Serial.print("CNTL: ");
  Serial.print(CNTL, HEX);
  Serial.print("\n");
*/
  
  Wire.beginTransmission(0x03);
  Wire.write(Start);
  //Wire.endTransmission();
  
}

void DataFormation(void) {

  byte temp;
  
  D1 = Start;
  temp = (D1 << 3) | TIDlow;
  D1 = (temp << 2) | (CNTL >> 6);

  
}

  • Sorry that first part got sent as code for whatever reason.

    Feels like this should be a pretty easy problem to solve but it's giving me a headache. I have an MSP430F5529 launchpad with 7.5kohm resistors being used as pullups from 3V3. When I run the code and connect SDA and SCL directly to an oscilloscope, both SDA and SCL are held high.I already found out that Wire.endTransmission() causes a hold up in the code so I commented it out. Also, when I leave in all the serial.print commands I can see based on the monitor that it is looping through the loop().

    Anyways I have a bit more information:
    I am using Energia 1.6.10E18
  • Kevin,

    Have you tried using one of the default Wire examples? Are you triggering the oscilloscope to make sure you catch any falling edges on the SDA line? What about weaker pull-up resistor values? Energia's Wire/I2C library is notoriously unreliable, I would recommend developing your application in CCS or writing straight C code. You can also refer to the 43Oh forum for Energia-specific support.

    Edit: This issue was resolved offline

    Regards,
    Ryan

**Attention** This is a public forum