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.

CODECOMPOSER: Isolating I2C pullups after I2C_close()

Part Number: CODECOMPOSER

I have had to use pullups on my I2C bus clock and data lines attached to a CC2640F128.

After I use I2C_close() and I put my 2640 to sleep, the SDA and SCL lines are still being held LOW, increasing my sleep current to 2ma from a few microamps.

Why doesn't closing the I2Chandle set the pins to an 'open' state?

What code do I need to add to fix this issue after I close the I2Chandle?

Thanks,

Dale

  • I don't which SimpleLink software you are using, but looking at simplelink_cc2640r2_sdk_4_30_00_08 the I2C_close() ends up calling PIN_close() on the pins for SDA and SCL.

    Where PIN_close() is documented as:

    /** @brief  Deallocate all pins previously allocated with a call to PIN_open().
     *
     *  Deallocate pins allocated to handle and restore these pins to the
     *  pool of unallocated pins. Also restores the pin configuration to what it was
     *  set to when PIN_init() was called.
     *  @param handle   handle retrieved through an earlier call to PIN_open().
     */
    extern void PIN_close(PIN_Handle handle);

    Does your program set an initial state for the SDL and SCL pins prior to calling I2C_open?

  • Thanks Chester, that was it.

    I had been trying all sorts of pin configs for SDA and SCL pins but could not find something that would leave them at tristate when I2C_close() was called.

    I never considered not even having them in the pin table.

    I just took them out of the pin table and now all is fine :)

    BTW I am making other progress, the RFID RC522 module on I2C is easy to communicate using the TI I2C library and the RC522 does not do any clock stretching.