element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Safe and Sound
  • Challenges & Projects
  • Design Challenges
  • Safe and Sound
  • More
  • Cancel
Safe and Sound
Blog MSP432 and TI-RTOS: I2C Configuration for Sensors BoosterPack
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 2 Jan 2017 10:50 PM Date Created
  • Views 1113 views
  • Likes 6 likes
  • Comments 0 comments
  • safe and sound
  • i2c
  • boosterpack
  • msp432
  • ti-rtos
  • ti_rt
Related
Recommended

MSP432 and TI-RTOS: I2C Configuration for Sensors BoosterPack

Jan Cumps
Jan Cumps
2 Jan 2017

How to get at the I2C signals of the MSP432 LaunchPad to the correct pins for the Sensors BoosterPack

image

The TI-RTOS examples for the MSP432 LaunchPad all route the I2C signals to pins that don't match the ones on the Sensors BoosterPack*. Let's fix that.

 

* also makes the TI-RTOS examples work for the Educational BoosterPack

 

What you need:

  • MSP432 LaunchPad
  • 1 micro-USB cable
  • Code Composer Studio
  • TI-RTOS for MSP43X
  • BOOSTXL-SENSORS

 

By default, the TI-RTOS examples route the I2C traffic to P1.6 and P1.7. But some BoosterPacks, such as our Sensors kit, expect it on P6.4 and P6.5.

image

 

image

Here are the changes you need to make to your MSP_EXP432P401R.c file to route them correctly for those boards.

 

Change the universal serial peripheral module to EUSCI_B1 (we also solve a possible SPI conflict with this, see the comments in the I2C section of the source file for more info):

 

const I2CMSP432_HWAttrs i2cMSP432HWAttrs[MSP_EXP432P401R_I2CCOUNT] = {
    {
        .baseAddr = EUSCI_B1_BASE,
        .intNum = INT_EUSCIB1,
        .intPriority = (~0),
        .clockSource = EUSCI_B_I2C_CLOCKSOURCE_SMCLK
    }
};

 

And configure the two2 I2C pins:

 

/*
 *  ======== MSP_EXP432P401R_initI2C ========
 */
void MSP_EXP432P401R_initI2C(void)
{
    /*
     * NOTE: TI-RTOS examples configure EUSCIB0 as either SPI or I2C.  Thus,
     * a conflict occurs when the I2C & SPI drivers are used simultaneously in
     * an application.  Modify the pin mux settings in this file and resolve the
     * conflict before running your the application.
     */

    /* Select I2C function for I2C_SCL(P6.5) & I2C_SDA(P6.4) */
    MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(
            GPIO_PORT_P6,
            GPIO_PIN5,
            GPIO_PRIMARY_MODULE_FUNCTION);

    MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(
            GPIO_PORT_P6,
            GPIO_PIN4,
            GPIO_PRIMARY_MODULE_FUNCTION);
    /* Initialize the I2C driver */
    I2C_init();
}

 

This results in the following setup:

  • J1.9, pin P6.5 is SCL
  • J1.10, pin 6.4, is SDA

That's what's needed according to the BoosterPack's doco:

image

 

I've tested this with an educational BoosterPack (I don't own a BOOSTXL-SENSORS). The example that I start from is the I2C TMP006 example in the Drivers folder of Resource Explorer.

image

The  BOOSTXL-SENSOR has a newer version of the temperature sensor (TMP007).

 

[CORTEX_M4_0] Starting the I2C example
System provider is set to SysMin. Halt the target to view any SysMin contents in ROV.
I2C Initialized!
Sample 0: 20 (C)
Sample 1: 20 (C)
Sample 2: 20 (C)
Sample 3: 20 (C)
Sample 4: 20 (C)
Sample 5: 20 (C)
Sample 6: 20 (C)
Sample 7: 20 (C)
Sample 8: 20 (C)
Sample 9: 20 (C)
Sample 10: 20 (C)
Sample 11: 20 (C)
Sample 12: 20 (C)
Sample 13: 20 (C)
Sample 14: 20 (C)
Sample 15: 20 (C)
Sample 16: 20 (C)
Sample 17: 20 (C)
Sample 18: 20 (C)
Sample 19: 20 (C)
I2C closed!

 

 

 

TI-RTOS Series
MSP432 and TI-RTOS: Getting Started Pt. 1 - Set Up and 1st RTOS Task
MSP432 and TI-RTOS: Getting Started Pt. 2 - Add an ADC Sample Task
MSP432 and TI-RTOS: Getting Started Pt. 3 - USB with Minimal CPU Use
MSP432 and TI-RTOS: PWM
MSP432 and TI-RTOS: I2C Configuration for Sensors BoosterPack
MSP432 and TI-RTOS: another I2C example - talk to a DAC
MSP432 and TI-RTOS: Sharp LCD BoosterPack
MSP432 and TI-RTOS: PID Library Part 1 - Intro
MSP432 and TI-RTOS: PID Library Part 2 - Real World Example
  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube