This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

TWI nrf_drv_twi_uninit (nRF52, S132)

Hello. I'm trying to stop TWI. (NRF52, S132)

SDK_11.0.0-2.alpha_bc3f6a0 s132_nrf52_2.0.0-7.alpha_softdevice

about 450uA current keep stop (disable) TWI. (default 2Hz advertising : about 60uA)

nrf_drv_twi_init (...) -> nrf_drv_twi_tx(...) -> nrf_drv_twi_uninit (..) The sequence of operation as the above.

But there are still some current consumption (450uA) after nrf_drv_twi_uninit (..). The symptoms must be completed after the normal communication.

Other sequences => Without communication(nrf_drv_twi_tx) nrf_drv_twi_init (...) -> nrf_drv_twi_uninit (..) => keep about 60uA !!! normal!!!

TWI, TWIM same.

nRF52 internal keep TWI????

Please tell us how to completely stop twi ...

PS. nrf_drv_twi_uninit(); nrf_drv_twi_disable(); same result.

Parents
  • This errata is relevant for this case. The power register mentioned is the TWI power register, not RADIO power register. For example for TWIM0 use this code:

    uint32_t *twim0_power = (uint32_t *)(NRF_TWIM0_BASE+0xFFC);
    *twim0_power = 0;   //turn off TWIM0
    *(volatile uint32_t *)twim0_power;    //wait for register to be written (CPU runs faster than the peripherals)
    *twim0_power = 1;   //turn on TWIM0
    
Reply
  • This errata is relevant for this case. The power register mentioned is the TWI power register, not RADIO power register. For example for TWIM0 use this code:

    uint32_t *twim0_power = (uint32_t *)(NRF_TWIM0_BASE+0xFFC);
    *twim0_power = 0;   //turn off TWIM0
    *(volatile uint32_t *)twim0_power;    //wait for register to be written (CPU runs faster than the peripherals)
    *twim0_power = 1;   //turn on TWIM0
    
Children
No Data
Related