<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: RTC on the Maple</title>
		<link>http://forums.leaflabs.com/topic.php?id=1043</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:22:54 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=1043" rel="self" type="application/rss+xml" />

		<item>
			<title>crenn on "RTC on the Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1043#post-6462</link>
			<pubDate>Tue, 20 Sep 2011 22:57:26 +0000</pubDate>
			<dc:creator>crenn</dc:creator>
			<guid isPermaLink="false">6462@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;The problem is that the default wire library uses pins 20 for SDA and 21 for SCL. If you wish to use Hardware I2C, I'd recommend giving my code a shot, it is available from here:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://forums.leaflabs.com/topic.php?id=1033&#34; rel=&#34;nofollow&#34;&#62;http://forums.leaflabs.com/topic.php?id=1033&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;It shouldn't require any code changes at all to get it to work with your RTC as it uses Hardware I2C port 1 (pins 9 and 5) by default.&#60;/p&#62;
&#60;p&#62;@robodude666, I haven't played with it yet, but I've been looking into playing around with it soon, I'll post if it I get working, but someone else may have already gotten it working.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>chumann on "RTC on the Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1043#post-6408</link>
			<pubDate>Tue, 20 Sep 2011 11:10:29 +0000</pubDate>
			<dc:creator>chumann</dc:creator>
			<guid isPermaLink="false">6408@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi Crenn,&#60;/p&#62;
&#60;p&#62;Thanks so much for the response.  I'm using the The ChronoDot RTC which uses the DS3231 chip with internal crystal.  From the retailers websight:&#60;/p&#62;
&#60;p&#62;&#34;The I2C interface is very straightforward and virtually identical to the register addresses of the popular DS1337 and DS1307 RTCs, which means that existing code for the Arduino, Basic Stamp, Cubloc, and other controllers should work with no modification.&#34;&#60;/p&#62;
&#60;p&#62;I've been using this RTC with good success on an Arduino UNO.  I've been trying to get it working on the Maple r5 using pin 5 for SCL and pin 9 for SDA using the default Wire library and the following code:&#60;/p&#62;
&#60;p&#62;#include &#38;lt;Wire.h&#38;gt;&#60;/p&#62;
&#60;p&#62;void setup()&#60;br /&#62;
{&#60;br /&#62;
 Wire.begin();&#60;/p&#62;
&#60;p&#62; // clear /EOSC bit&#60;br /&#62;
 // Sometimes necessary to ensure that the clock&#60;br /&#62;
 // keeps running on just battery power. Once set,&#60;br /&#62;
 // it shouldn't need to be reset but it's a good&#60;br /&#62;
 // idea to make sure.&#60;br /&#62;
 Wire.beginTransmission(0x68); // address DS3231&#60;br /&#62;
 Wire.send(0x0E); // select register&#60;br /&#62;
 Wire.send(0b00011100); // write register bitmap, bit 7 is /EOSC&#60;br /&#62;
 Wire.endTransmission();&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;void loop()&#60;br /&#62;
{&#60;br /&#62;
 // send request to receive data starting at register 0&#60;br /&#62;
 Wire.beginTransmission(0x68); // 0x68 is DS3231 device address&#60;br /&#62;
 Wire.send(0); // start at register 0&#60;br /&#62;
 Wire.endTransmission();&#60;br /&#62;
 Wire.requestFrom(0x68, 3); // request three bytes (seconds, minutes, hours)&#60;/p&#62;
&#60;p&#62; //while(Wire.available())&#60;br /&#62;
 {&#60;br /&#62;
   int seconds = Wire.receive(); // get seconds&#60;br /&#62;
   int minutes = Wire.receive(); // get minutes&#60;br /&#62;
   int hours = Wire.receive();   // get hours&#60;/p&#62;
&#60;p&#62;   seconds = (((seconds &#38;amp; 0b11110000)&#38;gt;&#38;gt;4)*10 + (seconds &#38;amp; 0b00001111)); // convert BCD to decimal&#60;br /&#62;
   minutes = (((minutes &#38;amp; 0b11110000)&#38;gt;&#38;gt;4)*10 + (minutes &#38;amp; 0b00001111)); // convert BCD to decimal&#60;br /&#62;
   hours = (((hours &#38;amp; 0b00100000)&#38;gt;&#38;gt;5)*20 + ((hours &#38;amp; 0b00010000)&#38;gt;&#38;gt;4)*10 + (hours &#38;amp; 0b00001111)); // convert BCD to decimal (assume 24 hour mode)&#60;/p&#62;
&#60;p&#62;   SerialUSB.print(hours); SerialUSB.print(&#34;:&#34;); SerialUSB.print(minutes); SerialUSB.print(&#34;:&#34;); SerialUSB.println(seconds);&#60;br /&#62;
 }&#60;/p&#62;
&#60;p&#62; delay(1000);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;Any feedback would be very much appreciated!&#60;/p&#62;
&#60;p&#62;Cheers
&#60;/p&#62;</description>
		</item>
		<item>
			<title>robodude666 on "RTC on the Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1043#post-6406</link>
			<pubDate>Tue, 20 Sep 2011 10:20:59 +0000</pubDate>
			<dc:creator>robodude666</dc:creator>
			<guid isPermaLink="false">6406@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Has anyone played with the STM32's built in RTC? I believe it only requires an external crystal and the pins for it are brought out.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>crenn on "RTC on the Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1043#post-6401</link>
			<pubDate>Tue, 20 Sep 2011 06:34:49 +0000</pubDate>
			<dc:creator>crenn</dc:creator>
			<guid isPermaLink="false">6401@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I've successfully interfaced with a ST M41T11 RTC using the default wire library and my Wire (hardware I2C) library. Which RTC do you have and can you share your code for accessing it? Which pins are you using for SDA and SCL?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "RTC on the Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1043#post-6387</link>
			<pubDate>Sun, 18 Sep 2011 18:58:41 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">6387@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;chumann - try searching the forum for DS3231 (which is an accurate real-time clock made by Maxim).&#60;br /&#62;
I vaguely remember someone talking about making it work. Sorry I can't be more specific.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>chumann on "RTC on the Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1043#post-6370</link>
			<pubDate>Fri, 16 Sep 2011 12:03:34 +0000</pubDate>
			<dc:creator>chumann</dc:creator>
			<guid isPermaLink="false">6370@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Greetings.  I'm desperately trying to get a Real Time Clock working on the Maple r5.  I've tried porting some of my libraries that have worked on the Arduino in conjunction with the Wire.h library but have had no success.  Has anyone been successful in using an RTC with the Maple?&#60;/p&#62;
&#60;p&#62;Thanks!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
