sparkfun RV-1805 Hook-Up Manual page 11

Qwiic real time clock module
Table of Contents

Advertisement

If your output is showing the incorrect time, you may need to recompile your sketch to get the latest compiler
time using the code from the first example. If this doesn't work, try restarting the Arduino IDE to get a new compiler
time.
Example 3 - Trickle Charging
To pull up the next example, go to File > Examples > SparkFun Qwiic RTC RV-1805 Arduino Library >
Example3-Trickle_Charging. This example will show us how to fiddle with the RTC's trickle charging circuit to
configure it for different charge rates as well as disable it if we want to use a coin cell battery.
The trickle charge circuit consists of a diode (0.3v or 0.6v drop) in series with a resistor (3kOhm, 6kOhm, or
11kOhm) These are available to pass into the function as
. The fastest possible rate, with a 0.3V diode and 3kOhm resistor is enabled by default. Note that the
ROUT_11K
trickle charger should only be used for charging the supercapacitor. Disable the trickle charger simply by calling
disableTrickleCharge()
Example 4 - Alarm Interrupt
To pull up the next example, go to File > Examples > SparkFun Qwiic RTC RV-1805 Arduino Library >
Example4-Alarm_Interrupt. This example shows how to enable and use the alarm interrupt to generate an
interrupt every time some or all of the alarm registers match the time register. First, we need to set up what time
we want the alarm to go off. To do this, we set the variables in the preamble to the time we would like. They default
to the values below as these are the default alarm values.
byte secondsAlarm = 0;
byte minuteAlarm = 0;
byte hourAlarm = 0;
byte dateAlarm = 0;
byte monthAlarm = 0;
Next, we need to set which parts of the time must match in order for the alarm to be triggered. to do this, we use
the
setAlarmMode(uint8_t mode);
you'd like to change how often the alarm is triggered. The values corresponding to which registers much match are
listed below.
: Disabled
0
: Hundredths, seconds, minutes, hours, date and month match (once per year)
1
: Hundredths, seconds, minutes, hours and date match (once per month)
2
: Hundredths, seconds, minutes, hours and weekday match (once per week)
3
: Hundredths, seconds, minutes and hours match (once per day)
4
: Hundredths, seconds and minutes match (once per hour)
5
: Hundredths and seconds match (once per minute)
6
if you've connected the optional battery.
where
is a number between 0 and 7. Go to line 60 (in the setup loop) if
mode
,
DIODE_0_3V
DIODE_0_6V
,
,
,
ROUT_3K
ROUT_6K

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the RV-1805 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents