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.

msp430g2744 i2c library

Other Parts Discussed in Thread: MSP430G2744, MSP430G2553, MSP430WARE

Hello all,

I've been searching around the web and the forum for an I2C library for msp430g2744, although there are several i2c libraries floating around for msp430, non of them that I found was for msp430g2744 or easy to modify,

As working with the examples didn't help me build the functions I'm in need for (start, stop, restart, read, write). I was hoping I could get some pointers here.

Thanks in advance,

Omri

  • The 2744 is quite new, so it likely hasn't made its way into the compatibility lists yet.

    However, it has an USCI module and its use is identical to the USCI module of the MSP430G2553, except perhaps for the port pins in use (I didn't check).

  • reading throw the msp430g2744 data sheet and the MSP430x2xx Family User's Guide it seems they are not compatible when it comes to i2c (p.402 section 14.2.4 and forward, all the registers mentioned there are missing from the datasheet and the msp430g2744 header file).


    I tried using i2c library for MSP430G2553, couldn't compile it with msp430g2744 header file for the reason above, so I used msp430g2553 header file instead, but the end result didn't work (trying to read a well known register on the slave).

  • This is strange. I just checked the datasheet and the registers listed there seem to be identical to the registers listed in the users guide.
    The G2744 has an USCI module like the G2553. Note that most of the other G devices do have an USI module, which also supports I2C but has a completely different inerface. Make sure you have the right example (USCI, not USI I2C).

    Omri Berg1 said:
    section 14.2.4 and forward,

    Is about the USI module, not the USCI module. See chapter 17 instead (USCI, I2C mode)

    Omri Berg1 said:
    I tried using i2c library for MSP430G2553, couldn't compile it with msp430g2744 header file for the reason above,

    It should work - unless the header file is buggy. (which sometimes happens for newer devices)

    Omri Berg1 said:
    so I used msp430g2553 header file instead

    Should be identical, regarding the USCI module.

    Omri Berg1 said:
    but the end result didn't work (trying to read a well known register on the slave).

    Well, this may have various reasons. Including hardware problems (missing external pullups, missing common GND) or a wrong slave address. Note that the slave address is 7 bit, without the R/W bit. Many slave datasheets give a combined 8 bit value as 'slave address'. Or rather one slave address for reading and one for writing.

  • Thanks for helping,

    It was my mistake as I used a library which was using the USI module and not the USCI module.

    I'm reading about the "TI_USCI_I2C_master" library, which seems like what I'm looking for, but it's not a part of msp430ware, I was wondering where can I found it?

  • No idea. Maybe it is linked as a separate example code on teh MSPs product page.

    Please note that the USCI of the 2x family devices is different from the USCI of the 5x family devices. Main difference is the interrupt handling (the 5x family has own IFG registers and one ISR per USCI module, while the 2x family utilizes the gloabl IFG2 register and A/B module share the same ISR for their RX and another one for their TX interrupts)

    So be sure to get an example code for 2x family USCI.

**Attention** This is a public forum