Rv-8803 not found by Red Board ESP32 IOT

Just received a Red Board ESP32 IOT and an RV-8803 RTC. Added library, connected QWiic cable and ran an example from the RV-8803 library. The module was not found. I have a red LED active on the RV-8803 Don’t know if I’m missing something, I assumed this was all I had to do to confirm module function.

Does the default blink work on the Iot redboard? https://learn.sparkfun.com/tutorials/io … le-1-blink

If so, then do you have any other i2c devices you can test next? It might also help if you share a photo of your setup/wiring

Finally, back to this problem. Blink works. I do not have any other qwiic devices. Error message is as follows:

configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:4832
load:0x40078000,len:16460
load:0x40080400,len:4
load:0x40080404,len:3504
entry 0x400805cc
Set Time on RTC
Device not found. Please check wiring. Freezing.
Ln 1, Col 1
SparkFun ESP32 IoT RedBoard
on COM63
2

wiring is qwiic cable from RV8803 to RedBoard

Example is RV8803 example 1 with no changes

Thanks

Are the LEDs active when you plug it in? Try the other qwiic port/swap cables if you haven’t already

Last, it might need to have the i2c pull up resistors disabled (scroll up 2 paragraphs)

If none of those work it is likely a DoA device - Was it purchased from us? If so head over to Return Policy - SparkFun Electronics (contact vendor if purchased elsewhere) and we’ll get ya squared away

OK Switched cable to new(shorter) cable. No change. Switched ports, no change. Cut pull up traces, no change. Device purchase through Amazon on June 27.

Just a thought, the RedBoard ESP32 IOT would be more useful to people integrating it into a final product if it had an on-board battery backed RTC.

It sounds defective; file for a replacement unit through Amazon if still possible :-/

I agree about the RTC thing; it’s always a game of features vs price…in the meantime you might be able to use NTP instead (if your project can access WiFi)?

Thanks for the speedy reply. I missed the return window for Amazon, not sure if I want to re-try this anyway. Any news on Arduino support for the Metro M7 series?

Is it necessary to set the address in the sketch for the RTC? I’d appreciate it if you could send a known working example for the red board ESP32 IOT and RV8803, so I can verify where the problem lies

Yes, you’d need to call the i2c address when using qwiic, for the RV8803 the i2c address is 0x32

…we don’t have known-working examples for all the combos of boards & sensors…we have working examples for the individual products and sometimes the hookup guides will cover some relevant sensor/devices, but we really just lay the groundwork

You can try using another item over i2c to help isolate the issue(s)…but if the RV8803 isn’t even lighting up it is very likely DoA

OK so how about a “generic example” of calling the I2C address?

Below is the code I am using:

/*
Setting time from the RV-8803 Real Time Clock
By: Andy England
SparkFun Electronics
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).

Feel like supporting our work? Buy a board from SparkFun!

This example shows how to set the time on the RTC to the compiler time or a custom time.

Hardware Connections:
Plug the RTC into the Qwiic port on your microcontroller or on your Qwiic shield/adapter.
If you are using an adapter cable, here is the wire color scheme:
Black=GND, Red=3.3V, Blue=SDA, Yellow=SCL
Open the serial monitor at 115200 baud
*/

#include <SparkFun_RV8803.h> //Get the library here:http://librarymanager/All#SparkFun_RV-8803

RV8803 rtc;

//The below variables control what the date and time will be set to
int sec = 2;
int minute = 47;
int hour = 14; //Set things in 24 hour mode
int date = 2;
int month = 3;
int year = 2020;
int weekday = 2;

void setup()
{
Wire.begin();

Serial.begin(115200);
Serial.println(“Set Time on RTC”);

if (rtc.begin(0x32) == false)
{
Serial.println(“Device not found. Please check wiring. Freezing.”);
while(1);
}
Serial.println(“RTC online!”);

//Use the time from the Arduino compiler (build time) to set the RTC
//Keep in mind that Arduino does not get the new compiler time every time it compiles.
//To ensure the proper time is loaded, open up a fresh version of the IDE and load the sketch.
//Also note that due to upload times, compiler time may be a little bit off on seconds/hundredths
if (rtc.setToCompilerTime() == false)
Serial.println(“Something went wrong setting the time”);
else
Serial.println(“New time set!”);

//Uncomment the below code to set the RTC to your own time
/if (rtc.setTime(sec, minute, hour, weekday, date, month, year) == false) {
Serial.println(“Something went wrong setting the time”);
}
/
//rtc.set24Hour(); //Uncomment this line if you’d like to set the RTC to 24 hour mode
}

void loop()
{
if (rtc.updateTime() == true) //Updates the time variables from RTC
{
String currentDate = rtc.stringDateUSA(); //Get the current date in mm/dd/yyyy format (we’re weird)
//String currentDate = rtc.stringDate(); //Get the current date in dd/mm/yyyy format
String currentTime = rtc.stringTime(); //Get the time
Serial.print(currentDate);
Serial.print(" ");
Serial.println(currentTime);
}
else
{
Serial.print(“RTC read failed”);
}
delay(1000);
}
From what I have been able to piece together, this code should work. However, I get an error at compile time. Surely someone at Sparkfun knows the proper way to do this. I am new to using I2C/QWIIC. I am curious why the example sketches do not work without modification.

Test this:

#include <Wire.h>
#include <RV8803.h> // Make sure you have this library installed

RV8803 rtc;

void setup() {
Serial.begin(115200);
Wire.begin();

if (rtc.begin() == false) {
Serial.println(“RTC not detected. Please check wiring. Freezing.”);
while (1);
}

Serial.println(“RTC online!”);

// Uncomment the following line to set the RTC to the compile time
// rtc.setToCompilerTime();
}

void loop() {
if (rtc.updateTime() == false) {
Serial.print(“RTC failed to update”);
} else {
String currentTime = rtc.stringTimeStamp();
Serial.print("Current RTC time: ");
Serial.println(currentTime);
}

delay(5000); // Wait for 5 seconds before next reading
}

It should give a message about a successful connection and print the time every 5 sec to the serial monitor

Try again. This time, try to compile the example before you send it.

  1. The #include statement for RV8893 is wrong. Needs to be

#include <SparkFun_RV8803.h>

  1. Some of the quote marks are unrecognized:

Serial.println(“RTC online!”);

  1. Some functions are not defined re:

String currentTime = rtc.stringTimeStamp();

even when I make the corrections to get the example to compile, I still get am RTC error:

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)

configsip: 0, SPIWP:0xee

clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00

mode:DIO, clock div:1

load:0x3fff0030,len:4832

load:0x40078000,len:16460

load:0x40080400,len:4

load:0x40080404,len:3504

entry 0x400805cc

RTC not detected. Please check wiring. Freezing.
Ln 2, Col 29
SparkFun ESP32 IoT RedBoard
on COM63
2
S

The code I corrected is listed below:

#include <Wire.h>
#include <SparkFun_RV8803.h> // Make sure you have this library installed

RV8803 rtc;

void setup() {
Serial.begin(115200);
Wire.begin();

if (rtc.begin() == false) {
Serial.println("RTC not detected. Please check wiring. Freezing.");
while (1);
}

Serial.println("RTC online!");

// Uncomment the following line to set the RTC to the compile time
// rtc.setToCompilerTime();
}

void loop() {
if (rtc.updateTime() == false) {
Serial.print("RTC failed to update");
} else {
//String currentTime = rtc.stringTimeStamp();
Serial.print("Current RTC time: ");
//Serial.println(currentTime);
}

delay(5000); // Wait for 5 seconds before next reading
}

Since I have missed the Amazon return window, if the module is determined to be DOA, can I get an exchange through Sparkfun?

| TS-Russell SparkFun Employee
September 5 |

  • | - |

Test this:

#include <Wire.h>
#include <RV8803.h> // Make sure you have this library installed

RV8803 rtc;

void setup() {
Serial.begin(115200);
Wire.begin();

if (rtc.begin() == false) {
Serial.println(“RTC not detected. Please check wiring. Freezing.”);
while (1);
}

Serial.println(“RTC online!”);

// Uncomment the following line to set the RTC to the compile time
// rtc.setToCompilerTime();
}

void loop() {
if (rtc.updateTime() == false) {
Serial.print(“RTC failed to update”);
} else {
String currentTime = rtc.stringTimeStamp();
Serial.print("Current RTC time: ");
Serial.println(currentTime);
}

delay(5000); // Wait for 5 seconds before next reading
}

It should give a message about a successful connection and print the time every 5 sec to the serial monitor

Ok, I grabbed my IoT Redboard and this version compiled correctly…I don’t have an RV8803 to test it with tho :-/

#include <Wire.h>
#include <SparkFun_RV8803.h> // Make sure you have this library installed

RV8803 rtc;

void setup() {
  Serial.begin(115200);
  Wire.begin();

  if (rtc.begin() == false) {
    Serial.println("RTC not detected. Please check wiring. Freezing.");
    while (1);
  }

  Serial.println("RTC online!");
  
  // Uncomment the following line to set the RTC to the compile time
  // rtc.setToCompilerTime();
}

void loop() {
  if (rtc.updateTime() == false) {
    Serial.println("RTC failed to update");
  } else {
    String currentTime = rtc.stringTimestamp();
    Serial.print("Current RTC time: ");
    Serial.println(currentTime);
  }

  delay(5000); // Wait for 5 seconds before next reading
}