-
1Important:
- The header sockets of the DS3231 must be desoldered and replaced by pins.
- The back of the display must to be protected with isolating tape to prevent a short circuit.
- The pins should be carefully cut as short as possible after soldering.
-
2Programming the Pico
Copy the terminal.uf2 on the Pico over USB or compile it with the Pico SDK and flash it using another Pico over SWD.
If you want to give the Picoprobe a try, but you are having trouble getting it to work, have a look at “openocd-memo.txt”.
-
3Soldering
Soldering should be straightforward as most components are through-hole. The Pico can be soldered using either the castellated edges or header pins. The header sockets of the DS3231 must be desoldered and replaced with pins. The pogo pins can be easily soldered, if they are held in place by the NanoPi.
After soldering I used a decent precision side cutter to carefully cut the pins as short as possible, so the battery doesn’t get damaged.
-
4Assembly
The standoffs should be fastened on the PCB before mounting the display. The back of the display must be protected with isolating tape to prevent a short circuit. I used 4 small patches of double sided adhesive tape to secure the display and the battery. Two layers of 1mm thick tape went under the display and one layer under the battery. If the pins of the switches are cut short enough, the battery won’t come in contact with them.
I printed the key labels with a Canon Selphy CP1300 printer. They proved to be surprisingly durable. The keycaps and labels are simply glued on the tactile switches.
The back panel has 3mm holes, because I couldn't find a laser cutting service in my area, that would do smaller ones. The 4 washers go between the standoffs and the back panel.
-
5Linux terminal configuration
The terminal works right out of the box while booting up DietPi (or FriendlyCore) the first time, but it will default to 80x24 monochrome. For color output on the whole screen and working function keys add the following lines to your .bashrc:
TERM=linux stty cols 100 rows 30
-
6DS3231 setup in DietPi
To use the DS3231 RTC first add "i2c0" to overlays= in /boot/dietpiEnv.txt without quotes and separated by a space, for example:
overlays=usbhost2 usbhost3 i2c0
After rebooting you can add the DS3231 as /dev/rtc1 by executing the following command as su (using sudo doesn't work):
echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-0/new_device
To sync the DS3231 to the system time:
sudo hwclock -f /dev/rtc1 -w
To sync the system time to the DS3231:
sudo hwclock -f /dev/rtc1 -s
Create a systemd service to sync the system time automatically during the boot process. Create /etc/systemd/system/add-rtc.service and add the following:
[Unit] Description=Sync system time to RTC Requires=sysinit.target [Service] Type=oneshot ExecStart=/usr/bin/bash -c 'echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-0/new_device' ExecStart=/sbin/hwclock -f /dev/rtc1 -s [Install] WantedBy=sysinit.target
Enable the service:
sudo systemctl daemon-reload sudo systemctl enable add-rtc
Use dietpi-config to disable the fake hardware clock and set time synchronization to custom.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.