Jump to content

Wrong I2C Interface for MSP430 F5529 LaunchPad?

Recommended Posts



   I have an MSP430 F5529 LaunchPad, R1.6. I am trying to use the Wire library to access I2C BoosterPacks. The problem is that the Wire library is accessing the I2C0 interface on pins 14 and 15, while the BoosterPack is connected to I2C1, on pins 9 and 10. How do I select which I2C interface the Wire library uses? I tried using Wire0 and Wire1, but these result in a compiler error -- Wire is the only object defined.


   Aren't pins 9 and 10 preferred for the I2C interface according to the suggested pinout? If so, then shouldn't the Wire library default to using this interface?


   Thanks for any info or insight!

Link to post
Share on other sites

So close, yet so far away! When I type Wire.setModule(1) into the IDE, the "setModule" part turns orange, like it is a known function. Yet when I try to build, I get an error saying "class TwoWire has no member named 'setModule'. Sure enough, the include path is hardware\msp430\cores\msp430, and when I examine Wire.h at that location, I can verify that the class TwoWire does not implement setModule. Yet I see that setModule is implemented for some other platforms, like the Stellaris.


Any ideas? Is this is mistake or oversight, or is there some reason that the MSP430 does not implement setModule? I am using version 0101E0016 of Energia.



Link to post
Share on other sites

It's coming.  IIRC one of the Energia developers checked in the code for this that might come with the new Energia 17 soon to be released.


It's not an oversight so much as a lack of desire to re-architect the MSP430 I2C code which was designed for the G2xxx era where there was only ever one I2C bus (and worked quite compactly for that chip)...

Link to post
Share on other sites

Thanks for all the information -- it is really helpful. Just one final thing to close this out:


We built our own BoosterPack board which contains several I2C sensors, and according to the BoosterPack pinout standard http://www.ti.com/ww/en/launchpad/byob.html, the I2C bus should be connected to pins 9 and 10. So we connected our I2C bus to these pins, according to the spec. Now we are trying to test the BoosterPack, only to find out that we cannot use it with the MSP430 F5529 using Energia because the F5529 Wire library defaults to the wrong I2C bus (at least according to the BoosterPack standard pinout), and it currently does not allow switching to the correct I2C bus.


My question is this: Is the default I2C bus issue only a problem with the MSP430 LaunchPads, or does the Wire library for many/all LaunchPads default to the wrong I2C bus according to the BoosterPack spec? Were we mistaken in connecting the I2C bus to pins 9 and 10 instead of pins 14 and 15, or is the mistake with the MSP430 Wire library defaulting to the wrong I2C bus according to the BoosterPack standards?


Thanks for any clarification.

Link to post
Share on other sites

TI has a habit of changing things, apparently.


The "original" default I2C should be on 14/15 [sCL(0)|SDA(0)]. Those are, as far as I can tell, consistent across the MSP430 LPs, including the "latest" FR6989.


However, MSP432 and LM4/TM4 LPs seem to be different, and put I2C on 9/10.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...