Can you show what commands were sent over i2c to set the RV-3028 and what pin is in use? Same library as above?
My additions to the mentioned sketch were essentially
Code:
RV3028 rtc;
bool connectToRTC()
{
// RTC power and ground
pinMode(17, OUTPUT);
pinMode(21, OUTPUT);
digitalWriteFast(17, HIGH);
digitalWriteFast(21, LOW);
bool success;
Wire.begin();
const bool set_24_hour = false;
const bool disable_trickle_charge = true;
const bool set_level_switching_mode = false;
const bool reset_status = true;
success =
rtc.begin(Wire, set_24_hour, disable_trickle_charge, set_level_switching_mode, reset_status);
return success;
}
void setup()
{
while (!Serial && millis() < 4000)
;
Serial.println("\n" __FILE__ " " __DATE__ " " __TIME__);
pinMode(20, INPUT_PULLUP);
pinMode(1, OUTPUT);
if (ARM_DWT_CYCCNT == ARM_DWT_CYCCNT) { // start Cyc Cnt if IDLE, i.e. T_3.x's
ARM_DEMCR |= ARM_DEMCR_TRCENA;
ARM_DWT_CTRL |= ARM_DWT_CTRL_CYCCNTENA;
}
if (!connectToRTC()) {
Serial.println("problems with RTC");
} else {
rtc.enablePeriodicUpdateInterrupt(true, false);
}
Serial.println("\n Waiting for PPS toggle ...\n");
while (digitalReadFast(20) == LOW)
;
while (digitalReadFast(20) == HIGH)
;
mytimer.begin(pulse, period);
mytimer.priority(192);
attachInterrupt(digitalPinToInterrupt(20), gps, FALLING);
}
using this lib: https://github.com/constiko/RV-3028_C7-Arduino_Library
Edit: Sorry didn't notice the other questions
What RV-3028 board do you have? Their DEMO board is what I got. What i2c setup did you do? And what pin is your 'PPS" on?
I'm using this RTC, suboptimal thought as CLKOUT isn't exposed
Regarding i2c, I'm using pin 18 and 19 on the teensy 4.1 (I guess this is the standard SDA/SCL), with the mentioned library. And the pps is on pin 20, note the RTC INT is a falling edge trigger from what I recall. I just picked the pins such that I can directly insert the RTC breakout into the teensy pins.