* your mileage may vary

Friday, 27 June 2014

Beaglebone Black (BBB) with DS1302 Real Time Clock (RTC)

Code to read or write date & time to or from DS1302 RTC
Code is a merge of the RTC-RPi and tutorial from Derek
Molloy examples of accessing the GPIO on the BBB

compile using g++ -O2 -Wall bbb-rtc.cpp SimpleGPIO.cpp -o bbb-rtc
run as ./bbb-rtc  or ./bbb-rtc YYYYMMDDHHMMSS

use xargs to update the system clock from command line
./bbb-rtc | xargs date -s

CLOCK = 45; //P8.11    These are the pin connections to the BBB
DATA  = 44; //P8.12
RESET = 47; //P8.15

source files here

No comments:

Post a Comment