MSP430FR2633: I2C (Initialization) Issue?

Expert 3750 points
Part Number: MSP430FR2633
Other Parts Discussed in Thread: CAPTIVATE-PGMR, DRV2605L, CAPTIVATE-PHONE

Tool/software:

Hi team, 

This is for a PCB connected to the CAPTIVATE-PGMR (CAPTIVATE-PGMR — CapTIvate ™ Technology Guide 1.83.00.08 documentation) through the 6-pin connector for programming ,debugging, and interfacing with the CapTIvate software. The 4-pin connector goes to an Adafruit breakout board for I2C communication to the DRV2605L haptics driver, which includes the pullup resistors on there (Adafruit DRV2605L Haptic Motor Controller - STEMMA QT / Qwiic : ID 2305 : Adafruit Industries, Unique & fun DIY electronics and kits).

I've also attached the source code, called "OneButton_Joy.zip". 

OneButton_Joy.zip

This project was originally generated via the CapTIvate software. It was just a one-button to microcontroller setup and the capacitive sensing aspect is working fine. Then, I tried to add I2C functionality and that part has not been working. 

Right now, the issue is that the code stalls at line 247, or whenever we try to send a byte through I2C (after taking the steps to initialize the I2C module), and we see no action on the SDA and SCL lines—they simply stay high. 

I am not sure if the I2C module has been initialized properly. Could you provide any assistance in understanding why we may be getting stuck here?

Best,

Luke

  • CAPT_BSP.c says:

       P1SEL1 = (GPIO_PIN2 | GPIO_PIN3);

    setting the SECONDARY function for P1.2/.3. This is incorrect, based on data sheet (SLAS942E) Table 6-17, which says that for I2C function PSEL=01, i.e. the PRIMARY function.

    This statement has been commented out, but it is correct:

    	/*GPIO_setAsPeripheralModuleFunctionInputPin(
    		GPIO_PORT_P1,
    		GPIO_PIN2 + GPIO_PIN3,
    		GPIO_PRIMARY_MODULE_FUNCTION
    	);*/ 

    I recommend that you un-comment it (or fix CAPT_BSP.c).

  • Hi Bruce,

    We had it in the commented-out configuration at first (as a primary function) and it was not working then. 
    Thus, we looked more into the datasheet and thought it could actually be a secondary function, so we changed it to the current code. 
    So, I think it would be another issue. 
    Do you know if we configured the clock for the I2C correctly?
    Best,
    Luke 
  • Was the symptom identical when you set PSEL=01 ("primary")? Specifically: No activity at all on P1.2/.3, both sitting high? 

    The I2C parameters look fine to me, based on the clock setup in CAPT_BSP.c. (SMCLK=16MHz/8)

  • Hi Luke,

    The user can follow the IP Phone Demo to see how it works to control the DRV26x device on the demo panel. The demo project is located in the following default Captivate Design Center directory:

    C:\ti\msp\CapTIvateDesignCenter_1.83.00.08\CapTIvateDesignCenter\example_projects\CaptivateDesignCenterWorkspace\TI_Examples\FR2633_CAPTIVATE-PHONE

    In that project look for the I2CMaster folder.  That has the I2C master drivers.  There is also a folder named DRV26x for the DRV drivers.

**Attention** This is a public forum