sandeepmistry / arduino-nRF5

Arduino Core for Nordic Semiconductor nRF5 based boards
Other
872 stars 278 forks source link

High power consumption in sleep mode with i2c and interrupt #495

Open muhdRiz07 opened 1 year ago

muhdRiz07 commented 1 year ago

Hi im using nrf52832 controller and i put it into sleep mode with _wfi(). The power consumption in sleep mode is 93uA. when i initialize i2c the power consumption is 93uA, which is fine for me.

But when i add attachinterrupt the current jumps to 560uA, which is not ok. Now if i remove i2c code section then the power consumption is again 93uA. when im using both the current jumps to 560uA.

so here i disable the i2c using below code before sleep, but the power consumption is similar. `NRF_TWI1->ENABLE = TWI_ENABLE_ENABLE_Disabled << TWI_ENABLE_ENABLE_Pos; NRF_TWI0->ENABLE = TWI_ENABLE_ENABLE_Disabled << TWI_ENABLE_ENABLE_Pos;

//correct errata 89 (volatile uint32_t )0x40004FFC = 0; (volatile uint32_t )0x40004FFC; (volatile uint32_t )0x40004FFC = 1;`