Jump to content
Sign in to follow this  

MSP430 and I2C

Recommended Posts

I have been trying to use a simple I2C sensor (LM75) with a MSP430FR5994. I find there are two pin maps. One at Energia (http://energia.nu/wordpress/wp-content/uploads/2016/11/Capture-2016-11-30-à-15.10.44.png) and one at TI directly (http://www.ti.com/lit/ml/slau677/slau677.pdf) on page 2. I have tried using I2C (1) as indicated at in the TI reference, and I have tried I2C (2) as indiicated in the Energia reference. neither one work. I can use an Arduino to access the sensor so I have some hope that this might work. What pins do I need to use to use I2C? Is there a library call to specify which I2C pins to use?

By the way, I can connect to the board and load the blink sample, and I can do serial communication, so board connectivity is OK, I2C is not.


Share this post

Link to post
Share on other sites

I did not have Wire.setModule(0); (or 1)

THanks to Rei Vilo for pointing out "setModule".

The code works now:


// This example code is in the public domain.

#include <Wire.h>

void setup()
  Wire.setModule(1); // For MSP430FR5994 SCL(1) = pin 5.1   //  SCA(1) = pin 5.0
  Serial.println("\nlm75 Sensor");

void loop() {
  // put your main code here, to run repeatedly:
   byte t;
    Wire.requestFrom(0x48, 1);    // request 6 bytes from slave device #2
    if(Wire.available()) t= Wire.read();   // if(Wire.available()) t[1]= Wire.read();
    Serial.print("temp: ");


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
Sign in to follow this