bought from sparkfun. am I missing a setting or does this one just have a bad crystal or something?/
Hi tacet321,
In order to make it easier for SparkFun support to assist you, I would suggest providing more information. How are you performing your tests of the RV-1805? How is the RTC connected? What is the code that you are using?
Cheers,
Adam
Hi tacet321.
If you check register 0x14, is there anything there or is it all zeros?
returns 117?
adam.g:
Hi tacet321,In order to make it easier for SparkFun support to assist you, I would suggest providing more information. How are you performing your tests of the RV-1805? How is the RTC connected? What is the code that you are using?
Cheers,
Adam
adam.g:
Hi tacet321,In order to make it easier for SparkFun support to assist you, I would suggest providing more information. How are you performing your tests of the RV-1805? How is the RTC connected? What is the code that you are using?
Cheers,
Adam
oops sorry for delay, code attached, using qwiic connection to qwiic shield on arduino, time printed as string to serial LCD, tested by checking display each day and noting about 13 minutes further behind each day
#define PIN_ANALOG_IN A0
#define AL_ADDR 0x48
#define STATUS_SD_INIT_GOOD 0
#define STATUS_LAST_COMMAND_SUCCESS 1
#define STATUS_LAST_COMMAND_KNOWN 2
#define STATUS_FILE_OPEN 3
#define STATUS_IN_ROOT_DIRECTORY 4
#define AdrJumper 0x29
#define PRINTING true
#define LOGGING true
#define COUNT 100
#include <DS18B20.h>
#include <Wire.h>
#include “SparkFun_VEML6030_Ambient_Light_Sensor.h”
#include <SoftwareSerial.h>
#include <SparkFun_RV1805.h>
#include “SparkFun_Qwiic_OpenLog_Arduino_Library.h”
OpenLog myLog1;
OpenLog myLog2;
RV1805 rtc;
SoftwareSerial LCD(10, 11);
SparkFun_Ambient_Light light(AL_ADDR);
DS18B20 ds(A3);
// Possible values: .125(1/8), .25(1/4), 1, 2
// Both .125 and .25 should be used in most cases except darker rooms.
// A gain of 2 should only be used if the sensor will be covered by a dark glass.
float gain = 2;
int ledPin = 13; //Status LED connected to digital pin 13
// Possible integration times in milliseconds: 800, 400, 200, 100, 50, 25
// Higher times give higher resolutions and should be used in darker light.
int time = 800;
int counter = 0;
double temp;
void setup(){
LCD.begin(9600);
delay (500);
String sS;
cls();
LCDwrite(“UWAC Sleep Kit”,“Sensor Box v2”);
LCD.write(0x7C);
//LCD.write(0x09);
LCD.write(0x0A);
delay (2000);
char compileDATE PROGMEM = DATE;
char compileTIME PROGMEM = TIME;
Serial.begin(9600);
delay (500);
Wire.begin();//initialize I2C bus
sS += reportStatus(“log 1 init”, myLog1.begin());
byte status1 = myLog1.getStatus();
sS += reportStatus(“log 1 status”, (status1 != 0xFF));
sS += reportStatus(“log 1 SD card”, (status1 & 1<<STATUS_SD_INIT_GOOD));
sS += reportStatus(“log 1 root dir”, (status1 & 1<<STATUS_IN_ROOT_DIRECTORY));
sS += reportStatus(“log 1 log file”, (status1 & 1<<STATUS_FILE_OPEN));
sS += reportStatus(“log 2 init”, myLog2.begin(AdrJumper));
byte status2 = myLog2.getStatus();
sS += reportStatus(“log 2 status”, (status2 != 0xFF));
sS += reportStatus(“log 2 SD card”, (status2 & 1<<STATUS_SD_INIT_GOOD));
sS += reportStatus(“log 2 root dir”, (status2 & 1<<STATUS_IN_ROOT_DIRECTORY));
sS += reportStatus(“log 2 log file”, (status2 & 1<<STATUS_FILE_OPEN));
sS += reportStatus(“real-time clock”, rtc.begin());
rtc.set24Hour();
rtc.enableTrickleCharge(DIODE_0_3V, ROUT_3K);
sS += reportStatus(“light sensor”, light.begin());
light.setGain(gain);
light.setIntegTime(time);
float gainVal = light.readGain();
int timeVal = light.readIntegTime();
myLog1.print(sS);
myLog2.print(sS);
printlog(“Reading settings…\r\n”);
printlog(String(“Gain:\t”)+String(gainVal, 3)+String(“\t”));
printlog(String(“Integration Time:\t”)+String(timeVal)+String(“\r\n”));
printlog(“\r\n”);
printlog(“date\ttime\tlux\tsound\ttemp(F)\r\n”);
temp = ds.getTempF();
}
void loop()
{
newData();
}
void printlog(String text)
{
if (PRINTING)
{
Serial.print(text);
}
if (LOGGING)
{
myLog1.print(text);
myLog2.print(text);
}
}
void cls()
{
LCDwrite(" “,” ");
}
void LCDwrite(char line1, char line2)
{
LCD.write(254);
LCD.write(192);
LCD.write(line2);
LCD.write(254);
LCD.write(128);
LCD.write(line1);
}
String reportStatus(String line1, bool success)
{
int pauseTime = 1000;
char charBuf1[line1.length()+1];
line1.toCharArray(charBuf1, line1.length()+1);
String message;
String text;
if (success)
{
message = " OK";
}
else
{
message = “{{{FAILURE}}}”;
pauseTime = 3000;
}
char charBuf2[message.length()+1];
message.toCharArray(charBuf2, message.length()+1);
cls();
LCDwrite(charBuf1, charBuf2);
text = line1+String(“: “)+message+String(”\r\n”);
Serial.print(line1+String(“: “)+message+String(”\r\n”));
delay(pauseTime);
return(text);
}
void newData()
{
if (rtc.updateTime() == false) //Updates the time variables from RTC
{
printlog(“\r\n\r\nRTC failed to update\r\n\r\n”);
}
uint8_t wtf = rtc.readRegister(0x14);
Serial.print("wtf: ");
Serial.println(wtf);
float luxf = light.readLight();
float dBf = (6.18433+(0.3978*analogRead(PIN_ANALOG_IN)-32.49+10))/1.228;
String lux=String(luxf,1);
String dB=String(dBf,1);
String Fahr = String(temp,1);
String lux0=String(luxf,0);
String dB0=String(dBf,0);
String Fahr0=String(temp,0);
String Date = rtc.stringDateUSA();
String Time = rtc.stringTime();
String Time0 = String(Time);
Time0.remove(5);
String line1;
String line2;
if (counter % COUNT == 0)
{
temp = ds.getTempF();
cls();
line1 = “[”+Time0+"] "+“t:”+Fahr0+“F”;
line2 = “dB:”+dB0+“, lx:”+lux0;
char charBuf1[line1.length()+1];
char charBuf2[line2.length()+1];
line1.toCharArray(charBuf1, line1.length()+1);
line2.toCharArray(charBuf2, line2.length()+1);
LCDwrite(charBuf1, charBuf2);
}
counter++;
//while (ds.selectNext()) {temp = ds.getTempF();}
printlog(Date + String(“\t”));
printlog(Time + String(“\t”));
printlog(lux + String(“\t”));
printlog(dB + String(“\t”));
printlog(Fahr + String(“\r\n”));
if (LOGGING)
{
myLog1.syncFile();
myLog2.syncFile();
}
}
I think something is wrong with the calibration settings inside the RV-1805 chip. Can you PM me your order number?
LS,
I have the same problem. I’m building a clock using neopixels, an firebeetle esp32 and the RV1805 as RTC.
Once a day I pull the time from NTP, and update the RTC with it. Printing out the time prior and after the update, gives about 15 minutes difference.
I chose the RV1805 because of its ability to handle low voltages as I’ll be running the clock off a LiPo. But for now I have it attached to my computer through USB, so it’s on full power.
I check register 0x14, and returns 7D steadily.
I live in the Netherlands, bought the chip through antratek.com, order nr #6000007774
–
regards
Lyon Lemmens