NetBurner 3.5.8
PDF Version
RV3032 I2C Real-Time Clock

Example Path: examples/I2C/Wire/RTC_RV3032

<examples/I2C/Wire/RTC-RV3032>

Supported Platforms: SOMRT1061 with DEV-SOMRT1061

External Real-Time Clock example using the Micro Crystal RV3032 RTC connected to the I2C bus, such as with the SOMRT1061-200IR on the DEV-SOMRT1061 development board containing the RV3032.

The example uses the Wire interface class for I2C operation, and requires an Internet connection to obtain the current time with NTP.

  • Creates a NtpClientServlet instance to run as a background task in the configuration server.
  • Reads the time stored in the RTC
  • Compares the two values and sets the RTC to the NTP time if there is a difference of 2 minutes or more.

There are multiple I2C peripherals on each NetBurner platform as indicated in the tables below. The first

line is the default.

SOMRT1061

SCL SOMRT PIN SDA SOMRT PIN Pin Func Module
Pin_EMC_12 9 Pin_EMC_11 10 PIN_FN_2 4
Pin_SD_B0_00 27 Pin_SD_B0_01 26 PIN_FN_2 3
Pin_AD_B1_00 40 Pin_AD_B1_01 41 PIN_FN_3 1
Pin_AD_B1_07 47 Pin_AD_B1_06 46 PIN_FN_1 3
Pin_EMC_22 92 Pin_EMC_21 91 PIN_FN_2 3

The numbers above are the values to pass to TwoWire(int sclpin, int sdapin), that is, Pins[] indices. For every row except the last they are also the module connector pin number.

The last row is the exception. Pin_EMC_22 and Pin_EMC_21 are secondary CPU pads bonded to the same traces as module connector pins 83 and 84, and they have their own Pins[] indices, 92 and 91. Wire the device to connector pins 83 and 84, but pass Pins[92] and Pins[91]. Passing Pins[83] and Pins[84] selects the primary pads EMC_26 and EMC_25, which have no I2C function, so no hardware module is bound and every transaction fails. That row also requires nothing else to drive those two traces.

A carrier board may already use some of these pins for other purposes. Check the schematic for the board in use.

MODM7AE70

Module SCL SDA
I2C0 P2.42 P2.39
I2C1 P2.12 P2.22
I2C2 P2.23 P2.26

SBE70LC

Module SCL SDA
I2C0 17 16

MOD5441X

Module SCL SDA
I2C0 J2.42 J2.39
I2C1 J2.41 J2.44

NANO54415

Module SCL SDA
I2C0 27 29
I2C1 22 20
I2C4 26 24
I2C5 34 32

SB800EX

Module SCL SDA
I2C4 5 4