Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to connect RTC device to the RPI
#1
There are 3 popular RTC chips: PCF8523, DSL1307 and a DS3231.

The RPI pinout can be found here:

https://pinout.xyz/


Attached Files Thumbnail(s)
   
Reply
#2
(05-06-2019, 05:34 PM)BlueWave Wrote: There are 3 popular RTC chips: PCF8523, DSL1307 and a DS3231.

The RPI pinout can be found here:

https://pinout.xyz/
thanks.. I have a problem. Those pins are used for the official 7" touchscreen.......
Reply
#3
You can use other GND/3V3/5V pins. Please have a look https://www.jameco.com/Jameco/workshop/c..._fig2a.jpg
Reply
#4
(06-26-2019, 04:18 PM)edy@weber.org Wrote:
(05-06-2019, 05:34 PM)BlueWave Wrote: There are 3 popular RTC chips: PCF8523, DSL1307 and a DS3231.

The RPI pinout can be found here:

https://pinout.xyz/
thanks.. I have a problem. Those pins are used for the official 7" touchscreen.......

Hi Edy, here are the exact steps I followed. 
Code:
sudo cp /boot/config.txt /boot/config.txt.backup
sudo nano /boot/config.txt
    #Add the following line
    dtoverlay=i2c-rtc,ds3231
sudo mv /lib/udev/hwclock-set /lib/udev/hwclock-set.backup
sudo nano /lib/udev/hwclock-set
    #If the following lines exist comment them out, if they do not exist, add them
    #if [ -e /run/systemd/system ] ; then
    # exit 0
    #fi
# Set date and time
#Check the date and time of the RTC
sudo hwclock -r
#Write the system time to the RTC
sudo hwclock -w
#Set the system time from the RTC
sudo hwclock -s
#Disable the fake-hwclock
sudo apt-get -y remove fake-hwclock
sudo update-rc.d -f fake-hwclock remove
sudo systemctl disable fake-hwclock
sudo reboot now
Thanks, Frank
Carputer Detail   Parts List
2004 Chevrolet Tahoe Z71 w/ Bose & Onstar
Reply
#5
(06-26-2019, 06:55 PM)frankpintosr Wrote:
(06-26-2019, 04:18 PM)edy@weber.org Wrote:
(05-06-2019, 05:34 PM)BlueWave Wrote: There are 3 popular RTC chips: PCF8523, DSL1307 and a DS3231.

The RPI pinout can be found here:

https://pinout.xyz/
thanks.. I have a problem. Those pins are used for the official 7" touchscreen.......

Hi Edy, here are the exact steps I followed. 

THANKS A LOT!!!!!!!!!!



Code:
sudo cp /boot/config.txt /boot/config.txt.backup
sudo nano /boot/config.txt
    #Add the following line
    dtoverlay=i2c-rtc,ds3231
sudo mv /lib/udev/hwclock-set /lib/udev/hwclock-set.backup
sudo nano /lib/udev/hwclock-set
    #If the following lines exist comment them out, if they do not exist, add them
    #if [ -e /run/systemd/system ] ; then
    # exit 0
    #fi
# Set date and time
#Check the date and time of the RTC
sudo hwclock -r
#Write the system time to the RTC
sudo hwclock -w
#Set the system time from the RTC
sudo hwclock -s
#Disable the fake-hwclock
sudo apt-get -y remove fake-hwclock
sudo update-rc.d -f fake-hwclock remove
sudo systemctl disable fake-hwclock
sudo reboot now
Reply
#6
(06-26-2019, 06:55 PM)frankpintosr Wrote:
(06-26-2019, 04:18 PM)edy@weber.org Wrote:
(05-06-2019, 05:34 PM)BlueWave Wrote: There are 3 popular RTC chips: PCF8523, DSL1307 and a DS3231.

The RPI pinout can be found here:

https://pinout.xyz/
thanks.. I have a problem. Those pins are used for the official 7" touchscreen.......

Hi Edy, here are the exact steps I followed. 
Code:
sudo cp /boot/config.txt /boot/config.txt.backup
sudo nano /boot/config.txt
    #Add the following line
    dtoverlay=i2c-rtc,ds3231
sudo mv /lib/udev/hwclock-set /lib/udev/hwclock-set.backup
sudo nano /lib/udev/hwclock-set
    #If the following lines exist comment them out, if they do not exist, add them
    #if [ -e /run/systemd/system ] ; then
    # exit 0
    #fi
# Set date and time
#Check the date and time of the RTC
sudo hwclock -r
#Write the system time to the RTC
sudo hwclock -w
#Set the system time from the RTC
sudo hwclock -s
#Disable the fake-hwclock
sudo apt-get -y remove fake-hwclock
sudo update-rc.d -f fake-hwclock remove
sudo systemctl disable fake-hwclock
sudo reboot now


sudo nano /boot/config.txt
    #Add the following line
    dtoverlay=i2c-rtc,ds3231
sudo mv /lib/udev/hwclock-set /lib/udev/hwclock-set.backup
sudo nano /lib/udev/hwclock-set
    #If the following lines exist comment them out, if they do not exist, add them
    #if [ -e /run/systemd/system ] ; then
    # exit 0
    #fi


I've connect ds3231 to raspberry and only applied these 9 lines steps. It's working now very good. I've done it in my first try. Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)