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 minimize the power consumption by shutting down the GPS, Si5351A and MCU 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 is 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. Hours, minutes and seconds are printed once per second 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.