How can I establish periodical sleep on Arduino nan IoT 33?

I am going to sleep my arduino nano iot 33 for 10 minutes, wake it up internally (withough external wakeup signal)
each 10 minute, send some data and again put it in sleep mode. I have searched a lot but none of
libraries that I find for low power in examples are compatible with nano iot 33. I have already LowPower.h
library. How can I do it?

The other problem you will have is that although you can send the processor to sleep the other components on the board will take significant power .

I’m unsure how to sleep that device, ( only played with one briefly ) the processor data sheet may well give clues .
I found this which might help

Welcome to the forum

Most of the information you need you will find under the following links.

https://www.arduino.cc/en/Reference/RTC

Install the RTCZero library using the library manager. Tools -> Manage Libraries...

Additionally, you might need the datasheet of the SAMD21. You can get it here

https://store.arduino.cc/arduino-nano-33-iot

As you will see the library does not seem to support the Nano 33 IoT. I believe the reason is that the supported boards have a 32kHz low power crystal on board and the Nano 33 IoT does not. So, you might need to modify the code to run the RTC from the main oscillator. I do not have time to test this myself today.

But, looking at the library source code. It might be sufficient to define CRYSTALLESS. See void RTCZero::configureClock() and void RTCZero::config32kOSC() called by begin().

Here are a few pointers how everything works behind the scenes.

  • The Nano 33 IoT uses a Microchip/ATMEL SAMD21 microcontroller (the other boards as well).
  • The controller uses an ARM Cortex-M0+ processor.
  • ARM defined a standard for these processors called CMSIS.
  • CMSIS describes how interrupts are handled by the software. The library uses CMSIS e.g. NVIC_EnableIRQ(), NVIC_SetPriority() and RTC_Handler()
  • CMSIS also has macros/intrinsics to put the processor to sleep. Also used by the library e.g. __WFI() means wait-for-interrupt when you call the rtc.standbyMode() function.

When you try this please take note of the comment in void RTCZero::standbyMode(). If you are too successful in putting the controller to sleep, double click the reset button to force the Arduino in bootloader mode if you need to regain control. :slight_smile:

I amirrezaheidari, I’m facing the same issue as you and I didn’t find any real option so far. Did you manage to succed? How did you tackle the issue?
Thanks in advance for your sharing, have a nice day. Andrea

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.