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.

MSP432P4111: How to optimize power setting UCSWRST for I2C peripheral within TI-RTOS I2C driver

Part Number: MSP432P4111

Hi, 

My goal is to optimize power consumption in a multithreaded TI-RTOS system on an MSP432P4111 with an I2C bus calling TI I2C Drivers from SimpleLink SDK 3.40.01.02. I use I2C as master only, and I want to keep the I2C peripheral in reset mode when it's not needed and activate it only when it's needed.

In this application note (9.1, page 12) it recommends keeping peripherals in reset mode by setting UCSWRST register bit.

I have managed to do that in an application layer, enabling/disabling I2C before and after each call to I2C_transfer() function.

However, I think that a better approach would be to integrate this reset/activate funcionality inside the I2CMSP432.c driver source file right at the point where primeTransfer() is called, so I can still benefit from the thread safety semaphores and message queues that the driver offers. Is there a supported way to do this?

Another possible option I was considering is to set/clear the UCSWRST when entering/exiting Sleep mode through the use of a PowerRegisterNotify function or Idle Power Policy Custom Function.

What would be the best way to achieve this?

Thank you very much for your attention, 

Álvaro

  • Hi Alvaro,

    Alvaro Muro said:

    However, I think that a better approach would be to integrate this reset/activate funcionality inside the I2CMSP432.c driver source file right at the point where primeTransfer() is called, so I can still benefit from the thread safety semaphores and message queues that the driver offers. Is there a supported way to do this?

    You have access to the source code. You should be able to modify it. Are you asking if there is a separate API to do this? I don't think there is.

    Srinivas

  • Hi Srinivas, 

    Thanks for your reply.

    Yes, that's right, I was wondering if there is an API or other supported way to do this, because I don't want to modify the driver source code at I2CMSP432.c. If the SDK is updated that file could be overwritten and my project would lose such functionality.

    Thus, I think I will stay with the solution of resetting/activating the UCSWRST bit at a wrapper layer around the I2C driver, protecting each bus with a mutex for thread safety.

    Best regards, 

    Álvaro

     

  • Hi Alvaro,

    I think the specific feature you are looking for is not available as a API. You might have already looked at this but you can see all the available ones in file:///<INSTALL_DIR>/docs/tidrivers/doxygen/html/_i2_c_8h_source.html

    So, I think you will have to implement it at the wrapper level as you suggested yourself.

    Srinivas

  • Thanks a lot Srinivas!