DWM1000 sleep and periodic synchronization

Hello. I have some DWM1000 driven by STM32F103C8 (I’m going to change right now to STM32L432, but it is the same).

In my app there is a master anchor that sends periodic signals so the linked tags knows when they have to listen. When a Tag get the first signal from the anchor a calculation is made and when it has to listen is calculated. Then a RX is made, and then a RX is made in a periodic basis.

For doing this I use dwt_setdelayedrxtime(). It works quite well, the internal clock is very accurate and it is a very robust algorithm. If the signal is lost, then the synchronization is made immediately. After dwt_setdelayedrxtime(), I set dwt_setrxtimeout(), and dwt_rxenable(). After this I wait until the RX is done with:

while (!((status_reg=dwt_read32bitreg(SYS_STATUS)) & (SYS_STATUS_RXFCG | SYS_STATUS_ALL_RX_TO | SYS_STATUS_ALL_RX_ERR)));

Now I want to optimize power consumption (thats why I move to STM32L432 for tags, and STM32L476 for anchor with display and touch screen).

The first thing is to use dwt_entersleep with wake up with sleep count, but the clock used is to coarse (steps of around 350 ms). So I use dwt_entersleep and wakeup with CS line. After dwt_rxenable() I call dwt_entersleep and wait around 500 ms (it has a period of 562.5 ms) and then call to wakeup the dwm1000 and make the reading with the same code as before.

I was expecting that the dwt_setdelayedrxtime() was stored (I initialize the sleeping with dwt_configuresleep(DWT_PRESRV_DLEEP | DWT_LOADOPSET | DWT_CONFIG, DWT_WAKE_CS | DWT_SLP_EN)), so when the dwm1000 wakes up then the algorithm should work as previously without the sleeping of the dwm1000.

That was what I expected to occur, but it does not. The synchronization algorithm cesases to work.

Is there anything I missed? This is not the way DW1000 low power mode works?

Please, what can I do for using low power mode while maintaining the synchronization?

Thanks in advance, regards.

when the device goes to sleep, the clock is switched off. I am not sure why you expected the delayed time to be preserved once the clock is turned off. For low power you are correct to use sleep mode, however you’ll need to employ an RTC or similar in your micro to keep you in sync, and be able to wake up in time for the expected frame.

Ok, thanks Zoran. I read about sleep and deepsleep, and in sleep I thought that the clock is not switch off. I was wondering as well how to select sleep and deepsleep, but I haven’t found how to.

If you need to use sleep, instead of deep sleep, you just need to set the WAKE_CNT

“The internal sleep timer counter expires, (assuming the WAKE_CNT configuration is bit is set in Sub-
Register 0x2C:06 – AON_CFG0 along with an appropriate SLEEP_TIM).”