This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Wake UP from deepsleep through SPI

Hi,

I am using nRF52832 along with Softdevice 6.0.0, SDK 15.0.0, Chip Revision 2 (QFAA-EX0).

The nRF52832 acts as SPI Slave and we want to wake up from Deepsleep when the master wants to talk to nRF52832 over SPI.

Is there a way by which we can wakeup on spi interrupt when nRF52832 is in DeepSleep?

If yes can you please point me to the code?

Also when in sleep what are the sleep options that will consume minimal current?

Thanks,

Justin

  • To deepsleep I am using this function call. 

    void deepsleep(void)
    {
        disable();
        spis0->enable = 0;
        power->ram0_powerclr = (1 << 17) | (1 << 16);
        power->ram1_powerclr = (1 << 17) | (1 << 16);
        power->ram2_powerclr = (1 << 17) | (1 << 16);
        power->ram3_powerclr = (1 << 17) | (1 << 16);
        power->ram4_powerclr = (1 << 17) | (1 << 16);
        power->ram5_powerclr = (1 << 17) | (1 << 16);
        power->ram6_powerclr = (1 << 17) | (1 << 16);
        power->ram7_powerclr = (1 << 17) | (1 << 16);
        power->systemoff = 1;
        while (1)
        {
            __asm("wfe");
        }
    }
    Is this the right way to deepsleep and make sure the power consumption is minimal? Please let me know if there are any other option nordic provides that could consume less current than the one above.
  • Deep sleep is achieved by calling NRF_POWER->NRF_SYSTEMOFF = 1; (or if the softdevice is enabled use sd_power_system_off()). The result is the same.

    Before going to sleep you should setup wakeup on CSN pin, such that when you wakeup (start of main() when using system OFF) you can check if the pin is low, and immediately enable SPIS. 

    Best regards,
    Kenneth

Related