E73 nrf52 sleep current
-
yes, you're right!
Started experimenting and noticed I was stupid assuming the sensors have nothing to do with this because if I disconnect them while sleeping nothing changes. Well they do. The issue is I2C/TWI. If I comment out all sensorcode sleep current goes down to a few uA. It looks like I can do Wire.init() without this problem, but as soon as the first transaction is done it won't sleep properly. Wire.end() before sleeping does not help (disables TWI). So something changes after a transaction.
To get it to minimum I commented all sensor code and only added (in setup())Wire.begin(); Wire.beginTransmission(0x40); Wire.write(0xFE); Wire.endTransmission();if the last line is commented sleep works fine (this is reset command to HTU21, one byte transaction).
I've tried undoing everything the wire-driver does before sleep, but can't figure out what helps.
Any ideas?I think the 250uA difference is related to whether HFCLK is running or not - if the device uses 250uA while sleeping my STlinkV2 works fine (re-program). If it goes down to a few uamps STlink does not work ,"can't connect target" (no reset pin used).
-
yes, you're right!
Started experimenting and noticed I was stupid assuming the sensors have nothing to do with this because if I disconnect them while sleeping nothing changes. Well they do. The issue is I2C/TWI. If I comment out all sensorcode sleep current goes down to a few uA. It looks like I can do Wire.init() without this problem, but as soon as the first transaction is done it won't sleep properly. Wire.end() before sleeping does not help (disables TWI). So something changes after a transaction.
To get it to minimum I commented all sensor code and only added (in setup())Wire.begin(); Wire.beginTransmission(0x40); Wire.write(0xFE); Wire.endTransmission();if the last line is commented sleep works fine (this is reset command to HTU21, one byte transaction).
I've tried undoing everything the wire-driver does before sleep, but can't figure out what helps.
Any ideas?I think the 250uA difference is related to whether HFCLK is running or not - if the device uses 250uA while sleeping my STlinkV2 works fine (re-program). If it goes down to a few uamps STlink does not work ,"can't connect target" (no reset pin used).
-
Hmm, should read the manual?
ERRATA [89] TWI: Static 400 µA current while using GPIOTE
after adding the workaround before sleep
*(volatile uint32_t *)0x40004FFC = 0; *(volatile uint32_t *)0x40004FFC; *(volatile uint32_t *)0x40004FFC = 1;sleep current goes down to 29uA. It's a bit high still but usable with AA batteries!
NRF_FICR->INFO.VARIANT tells my chip is version AAB0
-
@kisse66 have you reset it (on/off) after uploading it uses to much power, but after a reset, it drops. my modules drop to 30uA or something. So it should be possible to hit a low powerconsumption.
-
yes, I noticed it uses 3mA after re-program. Seems to keep debug circuits on. After power on/off goes down
-
-
Hmm, should read the manual?
ERRATA [89] TWI: Static 400 µA current while using GPIOTE
after adding the workaround before sleep
*(volatile uint32_t *)0x40004FFC = 0; *(volatile uint32_t *)0x40004FFC; *(volatile uint32_t *)0x40004FFC = 1;sleep current goes down to 29uA. It's a bit high still but usable with AA batteries!
NRF_FICR->INFO.VARIANT tells my chip is version AAB0
@kisse66 said in E73 nrf52 sleep current:
@omemanti
somehow missed that discussion...And so what is your sleep consumption now ? Do you still have the 20+µA, and if yes is it explainable by sensors consumption ?
-
@kisse66 said in E73 nrf52 sleep current:
@omemanti
somehow missed that discussion...And so what is your sleep consumption now ? Do you still have the 20+µA, and if yes is it explainable by sensors consumption ?
about 27uA (Rigol DM3085) @3.2V. It only drops 1-2uA if I disconnect the sensors (all wires towards HTU21,BMP085,VEML6075, BH1750) which is about what the datasheet for those say under shutdown. So most is taken by NRF52. There can be other peripherals that could be turned off still before sleep maybe. Now I only handle the I2C errata and then shut it off before sleep (wire.end), the rest is in mysensors code for sleep.
Sleep current does not change if I don't enable the DCDC. Perhaps the active current does a bit but can't measure it accurately (too fast).Just estimated that using AA-batteries it should last over 2 years. It only wakes up every 20min and runs about 400ms to send 7 values. But still I'd like to get better.
This is my rain gauge / multisensor under upgrade. It was earlier powered by mega328+NRF24. Worked fine about a year, but then something happened and it started taking 2mA while sleeping. Didn't see any visible reason why.