nrf52832 power consumption when disabling Twi driver (i2c)

Good morning,

It has been implemented a sleep mode to save battery when the board is not used.

To do that we follow the documentation and implemented the SystemOn mode and we've seen huge improvement in the power consumption (both in sleep and running mode)

When sleep mode is engaged all the peripheral are turned off.

To save power due to the twi driver we use the lines of code below.

Although we see good power save we think it is not enough.

The board when in sleep mode consumer around 550uA, but if the twi driver is not initialized at all, the consumption is around 280uA. So I guess there someting we can improve in the twi driver shut down sequence.

We are using nrf5 SDK 17.0.2

        /* Uninit all the TWI instances, this will put the hardware in a known state and stop any ongoing transfer, standard shutdown */
        for (uint8_t i = 0; i < I2C_BUS_N; i++)
        {
            nrf_drv_twi_disable(&busToTwiInstance[i]->twi);
            nrf_twi_mngr_uninit(busToTwiInstance[i]);
        }

Parents Reply
  • The board does not have a pull-up-resistor to the SDA/SCL.

    After disabling/uninit the i2c the consumption is still 550uA.
    The board without mcu consume around 200uA.

    The mcu is in SystemOn and adversting, using the Online Power Profiler for Bluetooth LE the mcu shall consume around 50uA. 

    Using the same firmware without initializing the I2C (twi0 an twi1 using easy dma) the consumption is around 250uA as expected and how we should want to have with the i2c disabled.

Children
  •   I am happy to run a debug session and report o you register status if you need to understand what is the issue.

    Thank you for support

  • Hi,

     

    If custom design; Is this repeatable on all your boards, or just one?

      

    Luca Nisti said:
    The board without mcu consume around 200uA.

    Does this mean that you physically remove or power off the nRF?

    Luca Nisti said:

    Using the same firmware without initializing the I2C (twi0 an twi1 using easy dma) the consumption is around 250uA as expected and how we should want to have with the i2c disabled.

    Could you verify that the SDA and SCL is set high, either by pull-up (via NRF_GPIO->PIN_CNF register), or externally?

    If these pins are floating, you will see excessive current leaked.

     

    Can you please share your sdk_config.h?

    I want to explicitly see if you are using NRF_TWI or NRF_TWIM, by checking the defines "TWI0_USE_EASY_DMA" and "TWI1_USE_EASY_DMA".

    If one or both are set to '0', try setting them to '1' and see if this has any impact.

     

    Kind regards,

    Håkon

  • Good morning  

    1. We measured the board consumption removing the mcu from the pcb, plus it is consistent with calculation done by the hw engineer.

    2. I checked the SDA and SCL pin status during the sleep mode and they are set correctly to save power

    3. Attached the sdk config file. I can confirm we are using the NRF_TWIM and TWI0_USE_EASY_DMA and TWI1_USE_EASY_DMA

  • The results are consistent with different boards.

  • Hi,

    Luca Nisti said:
    1. We measured the board consumption removing the mcu from the pcb, plus it is consistent with calculation done by the hw engineer.
    Luca Nisti said:
    The results are consistent with different boards.

    Thank you for confirming.

    Luca Nisti said:
    2. I checked the SDA and SCL pin status during the sleep mode and they are set correctly to save power

    Good to hear.

    Luca Nisti said:
    3. Attached the sdk config file. I can confirm we are using the NRF_TWIM and TWI0_USE_EASY_DMA and TWI1_USE_EASY_DMA

    It looks like you have forgotten to attach the .h file?

     

    Is the log module disabled? Should be sdk_config.h::#define NRF_LOG_ENABLED 0 to disable logging, as uart will cause the peripheral clock tree to run in sleep.

     

    Kind regards,

    Håkon

Related