BPI RTC real time Module13th June 2019
The RTC module maintains seconds, minutes, hours, day, date,month, and year information. The date at the end of the month is automatically adjusted for months with fewer than 31 days, including corrections for leap year. The clock operates in either the 24-hour or 12-hour format
with an AM/PM indicator. Two programmable time-of day alarms and a programmable square-wave output are provided. Address and data are transferred serially through an I2C bidirectional bus.
A precision temperature-compensated voltage reference and comparator circuit monitors the status of VCC to detect power failures, to provide a reset output, and to automatically switch to the backup supply when necessary. Additionally, the RST pin is monitored as a pushbutton input for generating a µP reset.
The RTC module is specifically designed for Banana Pi. It communicated with BananaPi through I2C bus. There is a Maxim DS3231 and 0.2uF SuperCapacitor on the board to keep the real time for a long time after the BananaPi has power off.
- 1. Use Maxim DS3231 chip
- 2. 0.2uF Super Capacitor
- 3. Operated by a shell
- 1. Smart home
- 2. Utility Power Meters
- 3. Telematics
- Accuracy ±2ppm from 0°C to +40°C
- Battery Backup Input for Continuous Time keeping
- Real-Time Clock Counts Seconds, Minutes,Hours, Day, Date, Month, and Year with Leap Year Compensation Valid Up to 2100
- Digital Temp Sensor Output: ±3°C Accuracy
- Two Time-of-Day Alarms
How To Use RTC Module:
Step 1: sudo su sudo apt-get install i2c-tool
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
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
1. Write the system time to file in dev/rtc1:
hwclock -w -f /dev/rtc1
2. Write the system time to file in /dev/rtc1:
hwclock -r -f /dev/rtc1
3. 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.
Click here to get required components for this project!