Skip to content

Melopero RV3028

RTC · I²C PROBE · RUNTIME DETECTION · ONE SOURCE FILE

The RV3028 is a clock chip with extremely low power draw. Its library sits in [arduino_base] and is therefore compiled into all 507 build targets — including the boards that carry no RTC at all. Across the whole firmware it is used in exactly one source file.

[!NOTE] Source. This page was verified against the firmware itself: MeshCore v1.16.0, commit 03b6ef4, 28 July 2026 — files platformio.ini and src/helpers/AutoDiscoverRTCClock.cpp.

What it does

The Micro Crystal RV-3028-C7 is a real-time clock that gets by on roughly 45 nA. Melopero's library talks to it over I²C: reading and setting the time, writing registers, and configuring what happens when the supply voltage drops away.

At the time of writing this chapter the upstream repository could not be found under the name the PlatformIO registry package gives; see ../dependencies.md.

How MeshCore pulls it in

platformio.ini r.25

  melopero/Melopero RV3028 @ ^1.1.0

The line sits in [arduino_base]. There is no build flag that switches it off: every board gets the library, whether an RV3028 is present or not.

How MeshCore uses it

MeshCore does not pick its clock chip with a compile flag but by looking at start-up to see who answers on the I²C bus:

src/helpers/AutoDiscoverRTCClock.cpp r.23-27

bool AutoDiscoverRTCClock::i2c_probe(TwoWire& wire, uint8_t addr) {
  wire.beginTransmission(addr);
  uint8_t error = wire.endTransmission();
  return (error == 0);
}

The RV3028's address sits as a constant at the top of the file (r.19), alongside those of the DS3231, the PCF8563 and the RX8130CE. If something answers on address 0x52, the chip is initialised and configured straight away:

src/helpers/AutoDiscoverRTCClock.cpp r.36-40

  if (i2c_probe(wire, RV3028_ADDRESS)) {
    rtc_rv3028.initI2C(wire);
    rtc_rv3028.writeToRegister(0x35, 0x00);
    rtc_rv3028.writeToRegister(0x37, 0xB4); // Direct Switching Mode (DSM): when VDD < VBACKUP, switchover occurs from VDD to VBACKUP
    rtc_rv3028.set24HourMode(); // Set the device to use the 24hour format (default) instead of the 12 hour format

AutoDiscoverRTCClock.cpp is the only one of the 590 source files in which the text RV3028 occurs.

What it means for a node

Detection happens afresh on every start. That means the same firmware works on a board with and on a board without an RV3028, without a separate build. The price is that the code for four clock chips always comes along, even when none is present.

The setting on register 0x37 makes the chip switch to backup power automatically when the supply voltage falls away. A node with an RV3028 and a coin cell therefore holds on to the time when the battery runs flat.

Sources

Translated from Dutch by Anthropic Claude