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
  • Good afternoon, I tried the following code with no success

        NRF_TWI_MNGR_DEF(nrfTwiMngr0, MAX_PENDING_TRANSACTIONS, TWI_INSTANCE_ID0);
        NRF_TWI_MNGR_DEF(nrfTwiMngr1, MAX_PENDING_TRANSACTIONS, TWI_INSTANCE_ID1);
        static const nrf_twi_mngr_t* const busToTwiInstance[I2C_BUS_N] =
        {
            &nrfTwiMngr0,
            &nrfTwiMngr1
        };
        
        
    
        nrf_drv_twi_disable(&busToTwiInstance[0]->twi);
        nrf_twi_mngr_uninit(busToTwiInstance[0]);
        nrf_drv_twi_disable(&busToTwiInstance[1]->twi);
        nrf_twi_mngr_uninit(busToTwiInstance[1]);
    
        *(volatile uint32_t *)0x40003FFC = 0;
        *(volatile uint32_t *)0x40003FFC;
        *(volatile uint32_t *)0x40003FFC = 1;
        *(volatile uint32_t *)0x40004FFC = 0;
        *(volatile uint32_t *)0x40004FFC;
        *(volatile uint32_t *)0x40004FFC = 1;

Children
  • Hi,

     

    Do you still measure 550 uA?

    Have you applied pull-resistors to the SDA/SCL lines after disabling the NRF_TWI instances?

     

    Kind regards,

    Håkon

  • 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.

  •   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

Related