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.

CCS/MSP-EXP430F5529LP: Simple I2C example?

Part Number: MSP-EXP430F5529LP
Other Parts Discussed in Thread: MSP430F5529

Tool/software: Code Composer Studio

Can someone point me to a simple (and hopefully commented) example of reading from an I2C device from the MSP-EXP430F5529LP. Like reading from a sensor - MPU9250, BMP280, etc. I feel like this should be one of the most basic examples and somehow I'm completely missing it.

I've found the examples that use 2 MSP-EXP430F5529LP to talk to each other, but those examples are mostly useless for example purposes. I'm looking for an example that reads from a sensor device. This means the MSP-EXP430F5529LP has to both write and read bytes from the I2C bus. The examples only do one or the other.

The driverlib example looks close, but how do I map the GPIO_PORT_P3 to the launchpads Px.x pin labels? Is that explained somewhere? Its not on the pinout document that came with the launchpad.

The ex1 master and slave examples are counterintuitive. The master should control the slave, but these examples are setup such that the master just listens and the slave just talks. What am I missing?

ex2 and ex3 have the master only transmitting. Again, shouldn't the master request data from the slave?

I think I'm just having trouble understanding the examples as they are not very well commented or self-explaining.

  • I think if you did a Google search or looked through the E2E forums you would find exactly what you are looking for, basic read & write communication with a I2C slave device. There have been several service requests of a similar nature in the past. But you are correct that the current public TI examples are lacking in this regard and there are plans to develop and provide better examples. Some I2C devices only need to be written to whereas others are only read from. To use both you need to combine multiple examples, one that writes to the slave device followed by one that reads from it. The slave address is sent in either case in accordance with the I2C protocol. MSP430F5529 USCIB0 I2C pins are on P3.0 and P3.1 and should be mapped accordingly, this can be found in the device datasheet.

    Regards,
    Ryan
  • The problem with existing examples is that none of them run on the MSP430F5529, so either way, I have to do significant modifications without a good direction. Getting the right pins is a huge step (thanks for that). I was using p4.1 & p4.2. It would be really nice if the GPIO labels that the driverlib uses was on the pin map that comes with the launchpad. There is a big disconnect there.

    Did I maybe just get the wrong launchpad in general? Is this too new or discontinued, or something? It looked like this was the most current launchpad out there.

    I think the 6 i2c examples could be condensed into one that covers all cases. Maybe one that shows how to request data from a slave device?

    Is there any timeline for useful examples? Is there some 3rd party code resource on github? All the ones I've found are for other msp430 processors.

    If you guys are developing new documentation and examples, can you take a look at the following links? This is an example of straightforward, simple, useful, and most importantly functional documentation & examples. I realize they have a single processor which makes everything much more manageable. I dont know if there is any way around that for the TI product line of completely incompatible processors and codebases. The point is this is an example of good documentation and examples that just work right out of the box (quality, not quantity)

  • Although you may not find an exact example for the MSP430F5529, any example that uses a USCIBx peripheral is a valuable starting point. You are most definitely allowed to use P4.1/P4.2 as well but you would have to use the port map module and change the examples to use USCIB1. The MSP-EXP430F5529LP is still adequately supported but not the newest LaunchPad, any FRAM variant was released afterwards.

    Regards,
    Ryan

**Attention** This is a public forum