viewtopic.php?f=140&t=293268
fanoush identified free space in neighborhood of GPIO headers.
I added image highlighting that area:
viewtopic.php?f=140&t=293268#p1772224
There was a statement from cleverca22 on soldering DS3231 SDA/SCL to GPIO pins ̴4̴+̴ 3 and ̴6̴ 5:
viewtopic.php?f=140&t=293268#p1773641
I don't buy this, when not using for other stuff, RTC just works.but those 2 pins are now stuck in i2c mode, you cant use them as gpio anymore
When disabling use of RTC in /boot/config.txt and /lib/udev/hwclock-set, then yes, RTC does not work and the pins ̴4̴+̴6̴ 3+5 can be used for something else. But the RTC clock keeps running from battery. So whenever changing back to using RTC and rebooting, magically the correct time will be there.
Also many people use pins ̴4̴+̴6̴ 3+5 for I2C anyway, so that is not a real problem for most.
In order to handle the not-use-as-I2C case, DS3231 VCC needs to be disconnectable from 3V3 from the Pi400 outside.
I have DS3231 modules at home since 4 years, but did not have one here in rehab hospital.
So I ordered one on Amazon, and it was delivered today:
https://www.amazon.de/-/en/gp/product/B ... le_o01_s00
I tested module outside of Pi400 first:
Before more on the tests, the zoomed bottom right part of module shows diode 102.
There is nothing wrong with that diode, it is part of recharging circuit of the module.
But in that case an LIR2032 rechargeable battery would have been needed on delivery.
That is more expensive than the CR2032 battery delivered together with the module.
All chargers state "don't charge normal batteries", and so I did fix the issue 4 years ago by cutting that diode:
https://forum.arduino.cc/index.php?topi ... msg3047461
I will do same with new module, before it will finally disappear in Pi400 inside.
Module dimensions 38 mm x 22 mm x 14 mm might be too big for fitting into the Pi400 free space.
Therefore I did order another DS3231 form factor that will arrive on Monday:
https://www.amazon.de/-/en/gp/product/B ... le_o00_s00
It has dimensions 1.4 x 1.3 x 1.3 cm, where part of vertical 13mm can be reduced by desoldering the 5x1 female headers.
So next I will follow Jeff Gerlings teardown instructions and see whether current DS3231 fits or not:
https://www.jeffgeerling.com/blog/2020/ ... and-review
After connecting the module, I followed these instructions:
https://www.instructables.com/Raspberry-Pi-DS3231/
And it worked, I verified this by powering off the Pi400 and waiting some minutes.
Then I disconnected DS3231 module.
After powering on, Pi400 connects to unsecured Wifi AP, but gets no internet.
For getting internet, I will have to enter name and password into network login page.
Until I do that, the old and incorrect time gets displayed top right (I use "%D %T" clock format with seconds).
Then I connected DS3231 again, powered off the Pi400 and waited some minutes.
After powering on, immediately when Desktop shows up, the correct time appears on top right of display.
With the active i2c-rtc dtoverlay DS3231 shows up as UU:
Code: Select all
pi@raspberrypi400:~ $ !i2c
i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- 57 -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@raspberrypi400:~ $
The python example pointed to from free ebook did not work (device busy):
https://github.com/Slaveche90/az-delivery-ds3231
After I did undo all changes and rebooted, DS3231 showed up as 68 and example "worked".
(funny, python code says that today is Monday, not Sunday)
The DS3231 has 32KHz output on module 32K pin:
https://datasheets.maximintegrated.com/ ... pdf#page=9
I measured 32695Hz with my 400Msps logic analyzer (100MHz over 10s).
Pigpio examples measure similar (I connected 32K pin to GPIO17):
Code: Select all
pi@raspberrypi400:~ $ sudo ./freq_count_1 17
Monitoring gpios 17
Sample rate 5 micros, refresh rate 10 deciseconds
g=17 -39 (32694/-830995011)
g=17 32698 (32714/1000495)
g=17 32698 (32701/1000100)
g=17 32698 (32690/999745)
^C2020-12-06 17:58:45 sigHandler: Unhandled signal 2, terminating
pi@raspberrypi400:~ $
Code: Select all
pi@raspberrypi400:~ $ sudo ./freq_count_2 17
Monitoring gpios 17
Sample rate 5 micros, refresh rate 5 deciseconds
17= 0
17= 32696
17= 32698
17= 32698
^C2020-12-06 17:59:47 sigHandler: Unhandled signal 2, terminating
pi@raspberrypi400:~ $
There is a "not(INT)/SQW" pin on DS3231 module as well, that can be programmed.
When implanting DS3231 into Pi400, I will make SQW as well as 32K pins accessible outside.
Since I have my Dremel at home and not here, female header longer cables will show through kensington lock hole (yes, they will have to pass all the way from right to left inside Pi400).