• sales

    WeChat:spotpear

  • support

    WeChat:zhoujie13424403025

Raspberry Pi Pico RTC Module DS3231 User Guide

Raspberry Pi Pico RTC Module DS3231 User Guide

Method 1: C Code (Raspberry Pi platform) 

1. Install the compilation environment 

sudo apt-get install cmake --fix-missing

sudo apt-get install gcc-arm-none-eabi


SDK download

git clone -b master https://github.com/raspberrypi/pico-sdk.git

cd pico-sdk

git submodule update --init --recursive


The program needs to point to the SDK path

export PICO_SDK_PATH=../../pico-sdk

(Change to your true path, Now you not need do this code , when you make program, you need this code )


1. Connect the hardware 



3. Run the program 

(1) Download, compile and run the sample program of pico-rtc-ds3231 (Download: Pico-RTC-DS3231_code.zip )

   cd ~/pico-rtc-ds3231_code/c/build

   sudo rm -rf ./*

   export PICO_SDK_PATH=../../pico-sdk

(Change to your true path )

   cmake ..

   make -j9

After that, the uf2 file will be generated under the build. 


(2) Press and hold Pico’s BOOTSEL and use the Micro USB cable to connect Pico to the Raspberry Pi’s USB and then release 



Open the build folder in the actual program folder, and pull the uf2 file into the above window 



(3) Use the editor to see the clock time 


   1.Open a new editor and enter: 1s -1/dev/tty*Carriage return, Can see /dev/ttyACM0  (You must also connect to PICO to see it)


   2.Open a new editor and enter: sudo minicom -s Carriage return


 (Need to install minicom: execute command  sudo apt-get install minicom



Change the dev/tt8 of line A to /dev/TTYACM0 and press Enter--Enter and select Exit 


 

Program running is visible 



Method 2: python Code (Raspberry Pi platfrom) 


1.installation Thonny IDE, Please refer to the official link

https://projects.raspberrypi.org/en/projects/getting-started-with-the-pico/2

 

2. Connect the hardware 

3. Run the program

Open the software to connect to Pico (Download: DS3231.py )



Open the corresponding program file (
Download: ds3231.py) and run the program 



Phenomenon:

Run the DS3231 program to print the initial time, and at the same time, the next 1 second will start to print once every 1 second. 

Price: $9.89
Part Number: Pico-RTC-Module-B
Brand: Spotpear
SKU: 0105315