OS: BPI-M3 Ubuntu15.10 (Kernel3.4) Version: 1.0 HDMI
Insert GPIO-Pin 1、3、5、7、9
Step 1:
sudo su sudo apt-get install i2c-tools
Step 2:Check the RTC (DS3231) device to see if it’s on track.(address 0x68) (I2c port number for M3: 2 )
i2cdetect -y 2
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- 68 – -- – -- – -- –
70: – -- – -- – -- – --
Step 3: Input RTC (DS3231) address
echo ds3231 0x68 > /sys/class/i2c-adapter/i2c-2/new_device
Step 4 : RTC (DS3231) Module is in /dev/rtc1
hwclock -w -f /dev/rtc1 ==> Write the system time to file in /dev/rtc1 hwclock -r -f /dev/rtc1 ==> Read the time in /dev/rtc1 hwclock -s -f /dev/rtc1 ==> Read the time in /dev/rtc1 and write the system time to file as well.
Video Demo:
Demo procedure:
- Check System Time (Video_Demo:1m 11s)
- Write the system time to file in dev/rtc1 (Video_Demo:1m 32s)
- Check the time in /dev/rtc1 (Video_Demo:1m 39s)
- Modify the system time (Video_Demo:1m 58s)
- Check System Time. (Video_Demo:2m 22s)
- Read the time in dev/rtc1 and write the system time to file as well. (Video_Demo:2m 26s)
- Check System Time. (Video_Demo:2m 30s)
more about RTC moudle,please see gitbook:
https://bananapi.gitbooks.io/bpi-accessories/content/rtcmodule.html