I have a RPI Pico H and the Pico Inky Pack by Pimoroni.
The pico slots directly into the display. I am wondering if and how it might be possible to add an RTC breakout to this setup?
Is it possible to sandwich the breakout between the pico and display header pins?
An RV3028 won’t fit between the two headers.
I have all three hear Pico header proto. You may be able to file down the two sides of the RV3028 and get it to fit between the two rows male headers / pins. It’s a do so at your own risk deal though.
I have a spare RV3028, that works, but won’t keep time on battery. I’ll see if I can break out my Dremel Tool (some time today) and see if I can get it to fit, and work. I’ll just plug it into my Pico Breakout Garden for testing after being resized.
Thanks, I appreciate your time.
I am trying to make alittle clock with a stopwatch function on my pico and e-ink display.
It works fine, but I have to connect the pico w to my home wifi to get the time and i’m trying to see if there is a way of setting it up so I can set the time initially to a battery fed rtc module and then be able to use the clock/stopwatch with battery power outside of any wifi range (using pico h).
If you have any other suggestions of how to do this i’m all ears 😊
What you could try is the Picowbell: Adafruit PiCowbell Proto for Pico - Reset Button & STEMMA QT. This might just work in between the Pico and the Inky, but I did not test it. The Picowbell gives you a Stemma/Qt connector and that is all you need for a RTC.
BTW: I think the RV3028 is absolutely over-priced. It is a very good RTC, but you don’t need this precision and for that price you can buy other stuff. Note also their is a Picobell with integrated RTC as well, but I am not sure if that would fit.
One other solution, if you buy a Pico-W and solder the pins yourself: use long pins, so you have pins on both sides.
Yet another solution: the pico omnibus: Pico Omnibus (Dual Expander)
The RV3028 isn’t going to fit on the Pico Proto between the two headers. I’m slowly cutting it back and starting to see cooper runs close to the edges on both sides. .
I would connect the RV3028 with a simple Stemma/QT-DuPont cable. Or, with e.g. the PCF8523, a simple QT-QT cable.
I do not want to jump in but I am wanting to do a similar thing and am nearly there. I have a PicoW for WiFi access when in range with the Pico Display Pack 2.0" and I need to insert a battery backed RTC plug in board. I could not find one at Pimoroni and so I had to buy the Adafruit PiCowbell Adalogger for Pico - MicroSD, RTC & STEMMA QT board with the Stacking Header Set for Raspberry Pi Pico (these have sockets and long through pins to allow me to plug the PicoW into the Ada RTC board, which is the same profile/size as the Pico, and then connect the LCD display to the Ada RTC board. It is sandwiched in between.
I can run all of my test programs, displays, graphics, ADC, etc, and when using the MicroPython I2C built in routines I can scan the I2C bus, which shows the RTC chip is being detected with its correct device address 0x68 (dec 104), which is the PCF8523 chip as used in this RTC board.
However, my very big snag is that I do not know how to set or read the PCF8523 chip (using python) and cannot find a library, which I can use with my Pimoroni UF2 file, which is pimoroni-picow-v1.21.0-micropython.uf2.
I can find demo code/libs from Adafruit using their circuitpython uf2, but I do not want to change from Pimoroni as we are using their boards and other add-ons for this and future projects and so would like to stick with Pimoroni.
Does anyone know how to set and read the PCF8523 rtc chip using Pimoroni’s uf2 python. I have seen suggestions but cannot actually find a solution that works. If anyone knows could they please assist. If there is a library out there could you please point me to it and mention how to load/use it.
Thanks in advance
Thank you @bablokb - that is exactly what I was looking for. I hit a snag at first but have now sorted it and so this is what I did, for others in case they have the same problem.
I got the pcf8523.py library and demo programs from the link you sent at github.
I copied the pcf8523.py library to my Pico W. When I tried any of the 3 demo programs they failed indicating that there was an I2C comms error. It was because the programs were usng I2C1, whereas the Adafruit board’s I2C wiring is linked to the GPIO pins of I2C0.
The simple solution was to change the line at the beginning in each of the demo programs from
i2c = I2C(1) to i2c = I2C(0)
When I ran the programs again the next error was from within the pcf8523.py library file at the section, around line 61, where it tests the RTC register for a default value. Maybe my PCF8523 chip’s register has a different default value. Anyhow, I am not sure that this test is necessary as the i2C had already found the PCF8523 device address 0x68 so it ought to be the correct chip. To get round the error I had to comment out the test - comment these two lines.
if (self.buf1 & 0b00000111) != 0b00000111:
raise ValueError(“Unable to find PCF8523 at i2c address 0x68.”)
After that it works so I now have an RTC board sandwiched between my Pico W board and LCD display. Incidentally that board also has an SD slot and it works well.
So again, thanks bablokb for pointing me in the right direction.
Yeah, this test you removed was in the original Adafruit CircuitPython driver code. This test is actually wrong and is now removed. Seems like the MicroPython driver code was a clone of the Adafruit code but did not track any upstream changes.
Thanks @bablokb for clarifying the test should be removed. Do you happen to know if there has been any update to this pcf8523.py library in case there are some other changes and if so, do you know where it could be found
Yes I know, simply because I was the author of the last major update of that driver :-)
You can find the source here: GitHub - adafruit/Adafruit_CircuitPython_PCF8523: Adafruit CircuitPython drivers for the PCF8523 realtime clock.
My major changes were:
- added support for timers (the PCF8523 has two timers in addition to the alarm)
- added support for the CLOCKOUT pin (the PCF8523 can output signals with fixed frequencies)
- refactor into a module
These changes are probably not of any relevance for you, since the Adalogger neither exposes the interrupt pin nor the clockout pin which is a real shame.
Ah, so that is why you know all about it. Well done and thank you for sharing.