br101 / zephyr-dw3000-examples

DW3000 Examples
19 stars 10 forks source link

sleep/deep sleep power consumption #4

Open induthings-coder opened 1 year ago

induthings-coder commented 1 year ago

I trying to measure the power profile for a battery powered application.

NCS 2.2.0 DWS3000 Shield v1.3 NRF52833-DK

I tested the examples:

TX_SLEEP TX_SLEEP_IDLE_RC TX_SLEEP_TIMED

but obtain the following profile:

image

seems that never entering to deep sleep...

br101 commented 1 year ago

I haven't tried with the examples, but I have successfully put the DW3000 to sleep using the API.

dwt_configuresleep(0, DWT_SLP_EN | DWT_WAKE_CSN);
dwt_entersleep(DWT_DW_INIT);
induthings-coder commented 1 year ago

issue is on wakeup pin control, I modified the code to use CS wakeup

image

config: / Configure sleep and wake-up parameters. / / DWT_PGFCAL is added to make sure receiver is re-enabled on wake. / dwt_configuresleep(DWT_CONFIG | DWT_PGFCAL, DWT_PRES_SLEEP | DWT_BROUT_EN | DWT_WAKE_CSN | DWT_SLP_EN);

sleep and restore sequence:

/ Put DW IC to sleep. Go to IDLE state after wakeup/ dwt_entersleep(DWT_DW_IDLE);

/ Execute a delay between ranging exchanges. / Sleep(RNG_DELAY_MS);

/ Wake DW IC up. See NOTE 5 below. / dwt_wakeup_ic();

Sleep(2); // Time needed for DW3000 to start up (transition from INIT_RC to IDLE_RC, or could wait for SPIRDY event)

while (!dwt_checkidlerc()) // check in IDLE_RC before proceeding { }

/ Restore the required configurations on wake / dwt_restoreconfig();

but the current on sleep is over 380uA, still flowing current through gpio or SPI. I can't find where...

because if you measure the current on DWM module, it's OK:

image

induthings-coder commented 1 year ago

for some reason Zephyr isn't entering in SLEEP mode, I forced it before delay and worked:

pm_state_force(0u, &(struct pm_state_info){PM_STATE_SUSPEND_TO_IDLE, 0, 0});

Sleep(RNG_DELAY_MS);

image