Hi:
I am new to nRF52 and using SDK17.
I got a power consumption issue about the TWIM.
Before calling "nrf_drv_twi_tx", the current is 0.18mA
After doing that the current stays at 0.36mA, and never draw
back to 0.18mA, even I call the disable and unint.
Can anyone help?
My code is as below
void i2c_init (void)
{
ret_code_t err_code;
const nrf_drv_twi_config_t i2c1_config = {
scl = I2C_SCL_PIN,
. sda = I2C_SDA_PIN,
. frequency = NRF_DRV_TWI_FREQ_100K,
. interrupt_priority = APP_IRQ_PRIORITY_HIGH,
. clear_bus_init = false
};
err_code = nrf_drv_twi_init(&g_instI2C, &i2c1_config, i2c_handler, NULL);
APP_ERROR_CHECK(err_code);
}
void i2c_Write(U8 u8SlaveAddress, U8 *pData, U8 u8Length)
{
ret_code_t err_code;
nrf_drv_twi_enable(&g_instI2C);
g_i2c_xfer_done = false;
err_code = nrf_drv_twi_tx(&g_instI2C, u8SlaveAddress, pData, u8Length, false);
APP_ERROR_CHECK(err_code);
while(g_i2c_xfer_done == false);
*(volatile uint32_t *)0x40004FFC = 0;
*(volatile uint32_t *)0x40004FFC;
*(volatile uint32_t *)0x40004FFC = 1;
}