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-EXP430G2ET: Software I2C on P2.1 and P2.2

Part Number: MSP-EXP430G2ET
Other Parts Discussed in Thread: MSP430G2253,

Tool/software: Code Composer Studio

Hello, I am new on programming MSP430 and work at the moment with the MSP430 Launchpad MSP-EXP430G2ET with the MCU MSP430G2253 on it. I have average knowledge on c-programming and the board runs with some sample programs without problems. At the moment i stuck on some point: Is there any documentation about the initialization of the I2C wires on Port P2.1 (SCL) and P2.2 (SDA)? I search now for a few days in the users guide from the MCU and in the users guide from the Launchpad, in the datasheet from the MCU and needed header files, without success. Anyone familiar with using the I2C on the pins P2.1 and P2.2? If i missunderstood something on the Launchpad PCB silkscreen itself, or on the little literature sheet which cames with the launchpad, please let me know. Thank you! Kind Regards

  • To answer your question: There's an appnote about software I2C on the MSP430 (the code is available as a link in the .pdf) here:

    http://www.ti.com/lit/an/slaa703a/slaa703a.pdf

    It was written for the FR2 series but as I recall it wouldn't require much fiddling to put it on an F2/G2 device (yours). There was a hazard in the demonstration code (not the driver) which, just glancing at the code, hasn't been fixed in rev A. The workaround is to move the myTransaction variable to make it global:

    https://e2e.ti.com/support/microcontrollers/msp430/f/166/t/685387

    -----------------------------

    That said: If you can, I suggest you start with the hardware I2C on P1.6-7. There are examples in Resource Explorer (I can't get there right now so I can't post a link) for the hardware I2C, and it will probably be simpler/faster.

  • Hello Bruce McKenney47378, thank you for your rapid answer! I follow your suggest and work at the moment with the Hardware I2C on Port 1, and it works fine. Maybe i will try out the Software I2C on Port 2 in the near future. Kind Regards!

**Attention** This is a public forum