SAMD21 (Pro RF LoRa) RTC: Usage and capabilities

I could use assistance with these items:

  1. Where can I find the associated Arduino RTC library?

  2. The product pages specifies a 32MHz External Oscillator, but the schematic shows a 32.768kHz crystal/resonator. Which one is correct?

  3. From other posts (eg #202356) it appears that this SAMD SBC can be put into sleep, then later wakeup via an RTC interrrupt. Is there sample code that goes with the Arduino RTC library that shows how to do this?

4a. Does this product offer full RTC capabilities; eg calendar year/month/day/time write & read?

4b. If so, are these features implemented in the Arduino RTC library?

Thanks in advance for your help.

There’s no “official” RTC library for this specific product, but please look at the guide for the SAMD21 IC: https://learn.sparkfun.com/tutorials/sa … time-clock

32.768kHz is the on board external oscillator.

We have not further expanded on the RTC capabilities of this product at this time. Please look for resources for the SAMD21 ICs where possible.

If you’re looking for full clock/calendar capabilities, it might be easier to attach an external hardware RTC to your Pro RF.

BOB-10160 should work for you, it’s battery backed up so it continues to keep time while your SAMD21 is off.

Hi @sparkin,

  1. The “official” RTC library for the SAMD21 is RTCZero: https://github.com/arduino-libraries/RTCZero

  2. The 32.768 kHz external crystal is used by the SAMD21 processor to drive the RTC (XOSC32K).

  3. See the official ArduinoLowPower library to place the SAMD21 in deep sleep: https://github.com/arduino-libraries/ArduinoLowPower

4a. Yes. The SAMD21 has these clock/alarm registers. See RTCZero library examples for more details on how to wake from RTC interrupts.

4b. Yes. See above.

An important thing to note is that the SAMD21 RTC, even with the external oscillator, will still experience drift. It’s nowhere near as stable as say the RV-8803 (BOB-16281). This drift, depending on temperature, is likely to be anywhere from 3-7 seconds a day.

See below for a comparison I did between the SAMD21 RTC and the Maxim DS3231 over a range of temperatures. You can see over the course of 20 hours, there was about 5 seconds of drift. I agree with YellowDog that you may be better off with a dedicated RTC for extended deployments.

Cheers,

Adam

https://i.imgur.com/sQqVAOq.png