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.

MSP430FR5969: I2C problems with the HDC2010

Part Number: MSP430FR5969
Other Parts Discussed in Thread: ENERGIA, , HDC2010, MSP430F5528

I'm using the MSP430FR5969 Launchpad with Energia 18 (sketch imported to CCSv7), and I can't seem to get I2C to work correctly.

My setup consists of the MSP430FR5969 Launchpad, the SHARP BoosterPack (96*96 px SPI Memory LCD) and a HDC2010 I2C temperature sensor. The HDC2010 is connected to pins 9 & 10 of the LaunchPad (SCL* & SDA* - because they're software emulated). The sketch simply displays the temperature that's read from the sensor on the SHARP LCD; ignore the part about energy because it's just constant alternative data for now. The functions that read the temperature have been tested on an Arduino Uno, and worked correctly.

Coming to my problem:

The display/serial terminal shows a temperature reading of -40, which is displayed when the board isn't communicating with the HDC2010. I'm using the HDC2010 EVM which includes a MSP430F5528 (that handles USB- I2C part when the device is used on its own) and the HDC2010 section can be broken off from the main board.

The first time I tried using it, I did not break it off, and simply connected the sensor portion to the Arduino Uno via a level translator (note that the MSPF5528 was also in the circuit and probably powered on, but not communicating since I powered the +3.3V rail to power the sensor). It worked fine and I  got readings. I then tried using it with the MSP430FR5969 Launchpad, and I didn't get any readings at first, and the logic analyzer revealed that one of the serial lines was remaining pulled up continuously. However, after some time, it started working correctly, but then stopped again.

After spending a lot of time troubleshooting it, I decided to break off the HDC2010 section (in case the MSP430F5528 was interfering). The sensor works fine with the Arduino Uno, but doesn't work with the MSP430FR5969. 

The logic analyzer reveals this:

I accidently made a few changes to the original sketch that worked, so I can't figure out whether it's a software problem or hardware (related to pull ups?; the time it worked, no pull ups were connected)
If no external pull up is connected, I get this:

Here's a screen capture of the time it worked with the MSP430FR5969:

  • Here's the code. Had to attach as a .docx because the editor hangs everytime I paste code.

    code.docx

  • Hi Avner,

    It looks like you've done a good job of going through all the steps here (energia.nu/guide/i²c-check-list/). I would begin by simplifying the sketch down to just the needed I2C functions you added and the supporting Wire() calls. In other words, let's simplify the problem a bit in the software by removing all of the LCD setup and loop code, in case that is somehow interfering. I looked over the SPI code and I don't see any conflicts that jump out at me, but it may still be worth trying. We'll certainly need the pullup resistors on pin 9 and 10 for the I2C to work. Looking at your data captures with pullup's present, it seems as though SDA can't be pulled down- there's not even a start condition on the bus.

    Walter
  • Hi Avner,

    Thanks for posting! Another thing you may want to look at are the pull up resister values. The schematic of the HDC2010 shows that 1.5K pull up resisters are implemented on the board. What frequency are you running the I2C peripheral? 1.5K resisters may still work, but I recommend using 10K resisters for 100KHz, and 4.7K for 400KHz (adjust accordingly for any other frequencies in between).

    If you are running the I2C at a frequency between 100KHz and 400KHz, I would try to switch out the 1.5K resisters on the HDC2010 board with a more appropriate value.

    Please let me know if you continue to have issues/questions!

    -Mitch

  • The oscilloscope shows that SDA actually goes high once SCK is active - which is the opposite of what should be happening. This is with 10k pullup resistors on both lines. Do you have any I2C program mind (Energia or CCS)  that contains the bare essentials to test I2C? This will need to be software emulated I2C to comply with the Boostpack standard.

  • Hi Mitch,

    If I'm not mistaken, the 1.5k pullup resistors on the HDC2010 EVM section are on the part with the MSP430. When the sensor section is broken seperate, the resistors aren't present.
    What's weird is that the time it worked fine, the MSP430 on EVM2010 was also connected. I thought that it might be interfering, so I broke it off. The sensor works fine with an Arduino Uno, but not with the MSP430FR5969 I'm using.
  • Hi Avner,

    Are you still having problems getting the I2C to work?
  • Hi Dennis, 

    Yes, I haven't manged to get I2C to work. Oscilloscope/logic analyzer traces both show unexpected behaviour: lines going high when they are active.

**Attention** This is a public forum