One more small success.
I found this code to scan the I2C bus for devices.
However you need to know what GPIO pins the device uses.
The Core Electronics page says to use Pin 9 and 10 GPIO 6 SDA and GPIO 7 SCL where the Wave Share Wiki says to use SDA 20 and SCL 21
Turns out Waveshare is correct.
This bus scan code correctly finds the device. Link Here
Hi Aaron,
That message is a long way down the thread. I wasn’t really expecting you guys to spot it. Well done. As it turned out I was using the settings (mostly) from Waveshare. But they have way too much fluff on their page.
Here is my work in progress in case someone else wants to take up where I left off. The routines to set the pico from the DS3231 and to set the DS3231 from the pico are working fine, just include the code and if the pico time is correct set the DS3231 time once. From then on each time the pico starts up set the time from the DS3231.
Have a look at the examples in the “main” section at the bottom. I added a routine to list all the device settings to the screen in binary but didn’t get very far figuring out if something was obviously wrong that was stopping the alarm from waking up the pico. ds3231.zip (3.1 KB)