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