Problem getting RTC rv8803 working on Pico Micropython

I am trying to get RTC rv8803 working on R pico under Micropython with QWIIC. The examples do not work. I use the following code:

#RTC RV8803 test

from machine import I2C, Pin
import sys
import time
import qwiic_i2c
import qwiic_rv8803

i2c = qwiic_i2c.get_i2c_driver(sda=4, scl=5, freq=10000)

devices = i2c.scan()
print(“13: I2C devices found:”, devices)

myRTC = qwiic_rv8803.QwiicRV8803(i2c,50)

def runExample():
print(“\nQwiic RV8803 Example 1 - Set Time\n”)

sec    = 2
minute = 47
hour   = 14
date   = 7
month  = 9
weekday = myRTC.kSunday
year   = 2025

myRTC.set_time(sec, minute, hour, weekday, date, month, year)

while True:
	myRTC.update_time()
	print ("Current Time: ", end="")
	print (myRTC.string_date_usa(), end="")
	print (" ", myRTC.string_time())
	time.sleep(1)

if name == ‘main’:
try:
runExample()
except (KeyboardInterrupt, SystemExit) as exErr:
print(“\nEnding Example”)
sys.exit(0)

This gives the following output and error:

%Run -c $EDITOR_CONTENT

MPY: soft reboot
13: I2C devices found: [50]

Qwiic RV8803 Example 1 - Set Time

Traceback (most recent call last):
File “”, line 39, in
File “”, line 28, in runExample
File “/lib/qwiic_rv8803.py”, line 512, in set_time
File “/lib/qwiic_rv8803.py”, line 473, in set_time_list
AttributeError: ‘int’ object has no attribute ‘writeBlock’

I think you need a MicroPython driver for the RV8803.

I import the driver: import qwiic_rv8803

I use the code as is given in de examples of Sparkfun, importing the I2C driver and the driver for the RV8803. There is no way the rv8803 driver is using the I2C driver, the call is always unsuccessful

I’m not sure that library has been ported to Micropython or not…do you have a different MCU you can use to test the 8803 with?

As far as I can see in the code both libraries are Micropython

Just looks like the parameters are swapped, should be myRTC = qwiic_rv8803.QwiicRV8803(50, i2c)

1 Like

thank you!