<?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: Considering Maple - some questions</title>
		<link>http://forums.leaflabs.com/topic.php?id=1029</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:14:13 +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=1029" rel="self" type="application/rss+xml" />

		<item>
			<title>mbolivar on "Considering Maple - some questions"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1029#post-6318</link>
			<pubDate>Tue, 13 Sep 2011 07:00:56 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">6318@http://forums.leaflabs.com/</guid>
			<description>&#60;blockquote&#62;&#60;p&#62;
in Chapter 6 &#34;Backup registers (BKP)&#34;&#60;/p&#62;
&#60;p&#62;I haven't noticed any code showing how to use them.&#60;/p&#62;
&#60;/blockquote&#62;
&#60;p&#62;this has been part of libmaple for quite some time :)&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://leaflabs.com/docs/libmaple/api/bkp.html&#34; rel=&#34;nofollow&#34;&#62;http://leaflabs.com/docs/libmaple/api/bkp.html&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;here is some (old and slightly embarrassing, but still hopefully serviceable) example code:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;https://github.com/leaflabs/libmaple/blob/master/examples/test-bkp.cpp#L1&#34; rel=&#34;nofollow&#34;&#62;https://github.com/leaflabs/libmaple/blob/master/examples/test-bkp.cpp#L1&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>tdc218 on "Considering Maple - some questions"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1029#post-6314</link>
			<pubDate>Mon, 12 Sep 2011 19:30:59 +0000</pubDate>
			<dc:creator>tdc218</dc:creator>
			<guid isPermaLink="false">6314@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;The FRAM sounds like an ideal solution and I'll be looking at those a bit closer.&#60;/p&#62;
&#60;p&#62;I have done PCBs but never with surface mounts parts, but I have a couple of acquaintances who have offered to help me out so I'm looking forward to expanding my skill set.&#60;/p&#62;
&#60;p&#62;I considered using flash but the 10,000 write life is too short.  It might take me a couple of years to exceed it but I'd hate to zorch a $60 board when there's a $2 solution.  So yeah, eeprom or fram will be the way to go.&#60;/p&#62;
&#60;p&#62;Many thanks for all the info and ideas.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>poslathian on "Considering Maple - some questions"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1029#post-6307</link>
			<pubDate>Mon, 12 Sep 2011 13:07:04 +0000</pubDate>
			<dc:creator>poslathian</dc:creator>
			<guid isPermaLink="false">6307@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;you could try using a page of the onbaord FLASH memory as nonvolatile storage, they are 1KB each on Maple and mini, 2KB each on RET6 and Native. They only get ~10,000 r/w cycles (officially...probably way more) so dont write to them in a loop or anything. I would go with the I2C eeprom, though. These are cheap and work fine.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Considering Maple - some questions"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1029#post-6304</link>
			<pubDate>Mon, 12 Sep 2011 05:53:27 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">6304@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;tdc218 - You might also look at the STM32F103's DMA controller. The DMA controller will shift a whole buffer full of characters without interruption. Frankly though, 9600 bps is only be an interrupt at, roughly, each millisecond, so the CPU overhead is minimal. &#60;/p&#62;
&#60;p&#62;Certainly have a go at porting the Arduino SerialTXManager code, that is likely simpler than using DMA.&#60;/p&#62;
&#60;p&#62;The SPI interface is simpler to use, and quicker than I2C.&#60;/p&#62;
&#60;p&#62;As well as EEPROM, you might want to consider FRAM. A friend uses it, and it has the nice property that you can read or write as fast as the interface will go, it is genuinely non-volatile RAM:&#60;br /&#62;
&#60;a href=&#34;http://uk.farnell.com/jsp/search/browse.jsp?N=203669+102138&#38;amp;Ns=P_PRICE_FARNELL_UK%7C0&#38;amp;locale=en_UK&#38;amp;appliedparametrics=true&#38;amp;getResults=true&#38;amp;suppressRedirect=true&#38;amp;originalQueryURL=/jsp/search/browse.jsp%3FN%3D203669%26No%3D0%26getResults%3Dtrue%26appliedparametrics%3Dtrue%26locale%3Den_UK%26divisionLocale%3Den_UK%26catalogId%3D%26prevNValues%3D203669&#34; rel=&#34;nofollow&#34;&#62;http://uk.farnell.com/jsp/search/browse.jsp?N=203669+102138&#38;amp;Ns=P_PRICE_FARNELL_UK%7C0&#38;amp;locale=en_UK&#38;amp;appliedparametrics=true&#38;amp;getResults=true&#38;amp;suppressRedirect=true&#38;amp;originalQueryURL=/jsp/search/browse.jsp%3FN%3D203669%26No%3D0%26getResults%3Dtrue%26appliedparametrics%3Dtrue%26locale%3Den_UK%26divisionLocale%3Den_UK%26catalogId%3D%26prevNValues%3D203669&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Have you got facilities to make a PCB, or must it be a DIL part? (The FRAM is surface mount)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>tdc218 on "Considering Maple - some questions"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1029#post-6301</link>
			<pubDate>Sun, 11 Sep 2011 20:29:22 +0000</pubDate>
			<dc:creator>tdc218</dc:creator>
			<guid isPermaLink="false">6301@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Many thanks everyone.  That gives me lots to ponder.  The info about the backup registers was especially useful in that my understanding of the Maple's CPU took a quantum leap.&#60;/p&#62;
&#60;p&#62;On the serial front, I'm constrained by my serial device that only runs at 9600 bps.  There's a Arduino library called SerialTXManager that gets around the blocking issue by using a buffer and poling the UART TXE flag via a call from the main loop.  Me thinks I'll have to look at porting the relevant bits of that.&#60;/p&#62;
&#60;p&#62;I2C EEPROMS are looking better all the time.  ;)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Considering Maple - some questions"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1029#post-6296</link>
			<pubDate>Sat, 10 Sep 2011 19:54:27 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">6296@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;A Farad is approximately the capacity to supply 1 Ampere for 1 second with a voltage change of 1 Volt&#60;/p&#62;
&#60;p&#62;6 months is approximately 15.75 million seconds.&#60;/p&#62;
&#60;p&#62;So, at 2uA, it'd need 2uA*15.75million = 31.5 Ampere seconds
&#60;/p&#62;</description>
		</item>
		<item>
			<title>crenn on "Considering Maple - some questions"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1029#post-6295</link>
			<pubDate>Sat, 10 Sep 2011 19:35:15 +0000</pubDate>
			<dc:creator>crenn</dc:creator>
			<guid isPermaLink="false">6295@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;The Maple needs to be modified to have the Vbat pin broken out, however, this isn't the case with the Maple Mini which does have it broken out. You can also look at using a super capacitor to hold enough charge for the backup registers and RTC, but you most likely won't get 6 months of life out of it (assuming disconnection for that period of time), but that's dependant on the supercapacitor.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Considering Maple - some questions"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1029#post-6288</link>
			<pubDate>Sat, 10 Sep 2011 13:17:57 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">6288@http://forums.leaflabs.com/</guid>
			<description>&#60;blockquote&#62;&#60;p&#62;1. Is serial.print blocking or non blocking?&#60;/p&#62;
&#60;/blockquote&#62;
&#60;p&#62;Blocking.&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;... IOW, if I do, say serial1.begin(300); serial1.println(&#34;Hello, world&#34;); will control be returns to me in a few microseconds, or in 40+ milliseconds after the entire string has printed?&#60;/p&#62;
&#60;/blockquote&#62;
&#60;p&#62;300bits/second would give 30 characters/second (accounting for start and stop bits).&#60;br /&#62;
strlen(&#34;Hello, world\n&#34;) is 14! (last time I looked the single character '\n' is expanded to two ASCII/UTF-8 characters on output).&#60;/p&#62;
&#60;p&#62;print/println will normally return after the last character has been accepted into the USART send buffer (before the character is sent), so we could reasonably expect it to return after 13 characters (it might be double buffered, making it a character faster). Hence control would return after 13/30th of a second, or roughly 430+ milliseconds.&#60;/p&#62;
&#60;p&#62;BUT, there may be choices available to you.&#60;br /&#62;
1. USART 1 will run at 4.5 Mbit/s, and the other two USARTs at 2.25 Mbit/s&#60;br /&#62;
2. You might be able to use SerialUSB, which is much faster than 300bits.&#60;br /&#62;
3. You might implement DMA which would return quickly (microseconds), and continue to operate in parallel with your program, while the DMA hardware moves characters to the USART autonomously. This mightbe too complex for you to feel comfortable.&#60;/p&#62;
&#60;p&#62;Edit: As an observation: if your Arduino program is currently doing I/O at 300bits, then a lot of CPU time will be wasted blocking. If you could use interrupts to output instead, then that might free up an enormous amount of CPU cycles, sufficient for your purposes.&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;How long will the battery hold the contents of the backup registers? My need is 6 months.&#60;/p&#62;
&#60;/blockquote&#62;
&#60;p&#62;The backup registers are part of the Real Time Clock (RTC) domain. The current used is under 2microAmps (2uA), according to Figure 17. &#34;Typical current consumption on VBAT with RTC on versus temperature at different VBAT values&#34; on page 43 of the STM32F103x8/xB datasheet:&#60;br /&#62;
&#60;a href=&#34;http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00161566.pdf&#34; rel=&#34;nofollow&#34;&#62;http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00161566.pdf&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;A 3V lithium button cell (hearing aid battery)&#60;br /&#62;
&#60;a href=&#34;http://en.wikipedia.org/wiki/List_of_battery_sizes#Lithium_cells&#34; rel=&#34;nofollow&#34;&#62;http://en.wikipedia.org/wiki/List_of_battery_sizes#Lithium_cells&#60;/a&#62;&#60;br /&#62;
has a capacity of roughly 30mAhour to 260mAhour&#60;br /&#62;
At 2uA, a 30mAhour cell might last 30,000uAhours/2uA = 15,000 hours = 625days, or almost 21 months.&#60;/p&#62;
&#60;p&#62;BUT, you would have to modify a Maple as the Vbat pin is connected to the rest of the power supply system, and it would need to be isolated or the battery would power the entire STM32F103, and be exhausted very quickly.&#60;/p&#62;
&#60;p&#62;The Backup registers are described in the RM0008 manual&#60;br /&#62;
&#60;a href=&#34;http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/REFERENCE_MANUAL/CD00171190.pdf&#34; rel=&#34;nofollow&#34;&#62;http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/REFERENCE_MANUAL/CD00171190.pdf&#60;/a&#62;&#60;br /&#62;
in Chapter 6 &#34;Backup registers (BKP)&#34;&#60;/p&#62;
&#60;p&#62;I haven't noticed any code showing how to use them. The RM0008 manual describes the steps needed to access them. They are not writable when the processor powers up to prevent them being accidentally overwritten, and the steps are to give access.&#60;br /&#62;
The registers are memory mapped, so you should be able to get at them by something like&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;(*uint16)0x40006C04 = ...;
uint16 myval = *((*uint16)0x40006C04);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;or&#60;br /&#62;
uint16 *bkp_registers = (*uint16)0x40006C04;&#60;br /&#62;
bkp_registers[0] = ...;`&#60;br /&#62;
Noting that the 2byte/16bit registers are not contigous, but instead exist at addresses 4 bytes apart (so bkp_registers[0] and bkp_registers[2] might be valid, but bkp_registers[1] and bkp_registers[3] would not be valid)&#60;/p&#62;
&#60;p&#62;(full diclosure: I am not a member of LeafLabs staff)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>tdc218 on "Considering Maple - some questions"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1029#post-6284</link>
			<pubDate>Fri, 09 Sep 2011 20:31:06 +0000</pubDate>
			<dc:creator>tdc218</dc:creator>
			<guid isPermaLink="false">6284@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Greetings all.  I've been building a project with the Arduino and have run out of IO and am getting pretty tight on memory and cpu cycles, hence the Maple (probably the Ret6) looks very attractive to me.  I have a few questions:&#60;/p&#62;
&#60;p&#62;1. Is serial.print blocking or non blocking?  IOW, if I do, say serial1.begin(300); serial1.println(&#34;Hello, world&#34;);  will control be returns to me in a few microseconds, or in 40+ milliseconds after the entire string has printed?&#60;/p&#62;
&#60;p&#62;2. I need a couple of dozen bytes of non-volatile storage which the EEPROM in the Arduino was handy for.  Hanging an external eeprom on the Maple is a possibility but seems kind of silly given my small storage needs and using flash doesn't seem like a good idea as the 10,000 write limit is uncomfortably low, so I'm looking at the back up registers in the CPU.  How long will the battery hold the contents of the backup registers?  My need is 6 months.  Can anyone point me to code examples for accessing the backup regs?  Are there any I should avoid using?&#60;/p&#62;
&#60;p&#62;Thanks in advance.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
