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.

I2C code for MSP430

Hello:

I'm trying the I2C code for MSP430 from this page:

http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=slaa368a

I need to use the USI device as an I2C slave.  Unfortunately the library code is written in assembly for a IARs’ development tools and does not compile under Code Composer.  Does anyone have a version that compiles under CCS?

Thanks again!

Paul

  • There are some smaller examples in C code for the USI in I2C mode both master and slave in the code examples found here.

    The code example site is here.

  • Paul,

    Did you try looking at the code examples for the device that you are using, you should find I2C examples. I pulled up the 2013 examples real quick, and it shows the following:

    msp430x20x3_usi_06.c              I2C Master Receiver, single byte
    msp430x20x3_usi_07.c              I2C Master Transmitter, single byte
    msp430x20x3_usi_08.c              I2C Slave Receiver, single byte
    msp430x20x3_usi_09.c              I2C Slave Transmitter, single byte

    Hope this helps.

     

    -Jason

     

  • Links don't quite work. If you go to the Tools and Software tab from the www.ti.com, then click on "MSP430 16-bit Ultra-Low Power MCUs" under the category called "Tools & Software Overviews by TI Platform", you'll get to a page with MSP430 stuff. Click the "Software" tab if it's not already where you're at.

    If you scroll down a little, you can click, and it'll show you links to download code examples for your line of microcontrollers. That's what I downloaded. Inside the .zip file, there's a bunch of code examples. Very helpful!

**Attention** This is a public forum