Have been trying to add variable sleep timings into the custom firmware. The sleep timings change during run-time. For this, I tried 2 methods to put the decawave module into sleep :
Setting the sleep time using dwt_configuresleepcnt() and then configuring the sleep using dwt_configuresleep(DWT_PRESRV_SLEEP| DWT_CONFIG,DWT_WAKE_SLPCNT | DWT_SLP_EN). Every time the spi rate is lowered for dwt_configuresleepcnt() , the device resets itself. Is there any other setting which I may have missed?
Configuring the wake up from sleep using SPICS pin. For this I used dwt_configuresleep(DWT_PRESRV_SLEEP | DWT_CONFIG, DWT_WAKE_CS | DWT_SLP_EN);. For waking up from sleep I used dwt_spicswakeup(). In this case the device got stuck at dwt_spicswakeup(). Could I have missed anything here as well?
In both the above cases I used dwt_entersleep() to put the decawave device to sleep.
I referred to the following example codes but was unable to put the decawave module to sleep:
It would be great to know the exact procedure for putting the device to sleep.