Real Time Clock

Even though the RFzero has a GPS receiver onboard that can be used for time keeping there may be situations where a Real Time Clock (RTC) may be useful, e.g. to save power by shutting down the GPS, Si5351A and MCU to an absolute minimum and then wake up later on.

The Arduino RTC reference has an overview of most of the RTC functions available.

Installing the RTC library

It might be that the RTC library is not installed in your Arduino IDE. If this the case you will get a compiler warning when you try to compile the RTC example below. If so then from the Arduino IDE select Menu | Sketch | Include Library | Manage Libraries  … Then type “rtcz” next to the Topic ALL to narrow the search result and select the RTCZero by Arduino library.

The RTC is fairly simple to include, setup and use once the RTC library has been installed.

RTC example

Below is an example of using the RTC where it is set by the GPS UTC time and the RTC hours, minutes and seconds are output ones per minute on the USB port.

The above example can be used without a GPS receiver e.g. on Arduino Zero or Arduino M0 boards. If so then remove the GPS receiver function and the calling of any RFzero relations.