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.

MSP432P401R: I2C Configuration to BOOSTXL-SENSORS (OPT3001) with FreeRTOS

Anonymous
Anonymous
Part Number: MSP432P401R
Other Parts Discussed in Thread: OPT3001

Hello, I am programming with the MSP432P401R Red Launchpad for the first time (actually my first time ever programming on a microcontroller).

My task is to establish an I2C connection between the MSP432P401R Red Launchpad and the Optical Sensor of the Sensor Boosterpack and save the measured value somewhere.

I have read the FreeRTOS Guide and understand the basics but I have never used I2C. All the examples I have seen of using I2C just leave me in the dark because I do not understand what the code is doing.

Is there any ressource which can explain to me how I establish a I2C connection between these (or similar) products? 

I have looked up the SCL/SDA pins for the products I am using and I know the address of the slave (the OPT3001 sensor) but I don´t really know what else I need to find on the datasheets.

I am using Code Composer Studio, maybe that information is important.

I appreciate any and all help, thank you!

  • Hi Adem,

    I would start by downloading the MSP432P4 SDK if you haven't already: http://www.ti.com/tool/SIMPLELINK-MSP432-SDK 

    I would also download the Sensor and Actuator Plugin for SimpleLink™ MCU SDKs: http://www.ti.com/tool/download/SIMPLELINK-SDK-SENSOR-ACTUATOR-PLUGIN 

    Within the plugin, there is a freeRTOS example to read lux value from a OPT3001 I2C optical sensor, it can be found at this file path: <INSTALL_DIRECTORY>\examples\rtos\MSP_EXP432P401R\sail\i2copt3001\freertos\ccs 

    the README includes example usage and application design details to help explain what the code is actually doing. 

    This should get you started!

    Thanks,

    Alexis

  • Anonymous
    0 Anonymous in reply to Alexis Crandall20

    Thank you that seems to be a good resource to start.

    I am having some problems building the project. I started a new CCS project and imported the i2copt3001 freertos example, but I got the "freertos install_dir cannot be resolved" error. 

    When I go to "Window" -> "Preferences" -> "Code Composer Studio" -> "Build" -> "Variables" and add a Variable "FREERTOS_INSTALL_DIR" as "Directory" and point to the FreeRTOS folder I now get other errors.

    One of them is 

    Cannot build project. Referenced project 'freertos_builds_MSP_EXP432P401R_release_gcc' contains build-errors. i2copt3001_MSP_EXP432P401R_freertos_gcc i2copt3001_MSP_EXP432P401R_freertos_gcc Problem

    And the 2 warnings I get are 

    Invalid project path: Include path not found (D:\Uni\I2C\FreeRTOS\FreeRTOS\Source\include). i2copt3001_MSP_EXP432P401R_freertos_gcc pathentry Path Entry Problem


    Invalid project path: Include path not found (D:\Uni\I2C\FreeRTOS\FreeRTOS\Source\portable\GCC\ARM_CM4F). i2copt3001_MSP_EXP432P401R_freertos_gcc pathentry Path Entry Problem

    I have both the "FreeRTOS" folder and the "Sensor and Actuator" folder in the folder "I2C" , is this wrong?

  • Hi Adem,

    Do you have FreeRTOS installed? Also, it appears you've imported the gcc project, you need the ccs project. 

    You also don't need to create a new CCS project. Just go to Project > Import CCS Project and navigate to the file path that i included in my previous post.

    Thanks,

    Alexis

  • Anonymous
    0 Anonymous in reply to Alexis Crandall20

    You are right, I imported the wrong project. Thank you for the help!

**Attention** This is a public forum