YMMV

* 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
http://derekmolloy.ie/beaglebone/beaglebone-gpio-programming-on-arm-embedded-linux

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
https://drive.google.com/file/d/0BwUGkFVOqZsPbjNOaWtvT1hzbkk/edit?usp=sharing

No comments:

Post a Comment