<?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; User Favorites: Natalie</title>
		<link><a href='http://forums.leaflabs.com/profile.php?id=4182'>4182</a></link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:14:31 +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?profile=4182" rel="self" type="application/rss+xml" />

		<item>
			<title>pmp0x on "Display Shields"</title>
			<link>http://forums.leaflabs.com/topic.php?id=999#post-12455</link>
			<pubDate>Wed, 15 Aug 2012 17:35:48 +0000</pubDate>
			<dc:creator>pmp0x</dc:creator>
			<guid isPermaLink="false">12455@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I try to make it work right now…haven't tested it much but the basic is working…(still lot of nasty Debug and so on… no cleanup at all)&#60;br /&#62;
you can find it here:&#60;br /&#62;
&#60;a href=&#34;https://github.com/pmp0x/StudienarbeitX&#34; rel=&#34;nofollow&#34;&#62;https://github.com/pmp0x/StudienarbeitX&#60;/a&#62;&#60;br /&#62;
Check Library/WiFlySerial it's from this side:http://cairohackerspace.blogspot.de/
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Display Shields"</title>
			<link>http://forums.leaflabs.com/topic.php?id=999#post-12446</link>
			<pubDate>Wed, 15 Aug 2012 10:49:31 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">12446@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I am also looking for a way to modify the wiFly lib for Maple.&#60;/p&#62;
&#60;p&#62;The lib Natalie is refering to must have been updated. Or maybe an older version of the lib was used (if so, wich one?).&#60;br /&#62;
Anyone has a workaround he can post for everyone to know?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>robodude666 on "Display Shields"</title>
			<link>http://forums.leaflabs.com/topic.php?id=999#post-11748</link>
			<pubDate>Sun, 15 Jul 2012 11:21:45 +0000</pubDate>
			<dc:creator>robodude666</dc:creator>
			<guid isPermaLink="false">11748@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;You should have no issue getting the TouchShield to work.&#60;/p&#62;
&#60;p&#62;It only uses D2 and D3 for software serial communication. Otherwise, the TouchShield is an Arduino on its own with an LCD and its own IDE. You create the Maple and TouchShield sketches separately. Use serial to communicate between the two. Here's an article on it:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://iamshadowlord.com/2010/03/touchshield-slide-two-way-communications.html&#34; rel=&#34;nofollow&#34;&#62;http://iamshadowlord.com/2010/03/touchshield-slide-two-way-communications.html&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>asterix on "Display Shields"</title>
			<link>http://forums.leaflabs.com/topic.php?id=999#post-11720</link>
			<pubDate>Fri, 13 Jul 2012 09:29:14 +0000</pubDate>
			<dc:creator>asterix</dc:creator>
			<guid isPermaLink="false">11720@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I downloaded the library you referenced too however I'm getting far more compile errors than just one. Its also missing quite a few of the files you're referring to (_spi.h, _spi.c etc). Any chance you could send me your working library?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Natalie on "Display Shields"</title>
			<link>http://forums.leaflabs.com/topic.php?id=999#post-7943</link>
			<pubDate>Mon, 30 Jan 2012 03:57:03 +0000</pubDate>
			<dc:creator>Natalie</dc:creator>
			<guid isPermaLink="false">7943@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I finally sorted it out ...&#60;br /&#62;
Note that the following is for the SPI1 port, but can be easily modified to match the SPI2 or SPI3 port if available ...&#60;/p&#62;
&#60;p&#62;* In &#34;_spi.h&#34;, include the &#34;stdint.h&#34; and remove the &#34;pins_arduino.h&#34;&#60;br /&#62;
* In &#34;_spi.c&#34;, include headers &#34;_Spi.h&#34;, &#34;libmaple.h&#34;, &#34;spi.h&#34;, &#34;wirish.h&#34;&#60;br /&#62;
* In &#34;_spi.c&#34;, declare the pins as follow:&#60;br /&#62;
void SpiDevice::_initPins() {&#60;br /&#62;
    pinMode(BOARD_SPI1_MOSI_PIN, OUTPUT_AF_PP);&#60;br /&#62;
    pinMode(BOARD_SPI1_MISO_PIN, INPUT);&#60;br /&#62;
    pinMode(BOARD_SPI1_SCK_PIN, OUTPUT_AF_PP);&#60;br /&#62;
    pinMode(_selectPin, OUTPUT);&#60;br /&#62;
    deselect();&#60;br /&#62;
}&#60;br /&#62;
* I create the &#34;OUTPUT_AF_PP&#34; case in &#34;wirish_digital.cpp&#34; and &#34;io.h&#34; like this:&#60;br /&#62;
case OUTPUT_AF_PP:&#60;br /&#62;
    outputMode = GPIO_AF_OUTPUT_PP;&#60;br /&#62;
    pwm = false;&#60;br /&#62;
    break;&#60;br /&#62;
* In &#34;_spi.c&#34;, to initialize (based on spi_init and spi_reconfigure taken from spi.c):&#60;br /&#62;
void SpiDevice::_initSpi() {&#60;br /&#62;
    rcc_clk_enable(SPI1-&#38;gt;clk_id);&#60;br /&#62;
    rcc_reset_dev(SPI1-&#38;gt;clk_id);&#60;br /&#62;
    //Disable&#60;br /&#62;
    spi_irq_disable(SPI1, SPI_INTERRUPTS_ALL);&#60;br /&#62;
    spi_peripheral_disable(SPI1);&#60;br /&#62;
    //Mode hardware (to manually drive the NSS pin with the select/deselect functions)&#60;br /&#62;
    //SC16IS750 supports 4 Mbit/s maximum SPI clock speed means this can theoretically handle the SPI_BAUD_PCLK_DIV_32 (2.25 MHz) divider ...&#60;br /&#62;
    //speed = SPI_BAUD_PCLK_DIV_64 = 1.125 MHz&#60;br /&#62;
    //speed = SPI_BAUD_PCLK_DIV_32 = 2.25 MHz&#60;br /&#62;
    //speed = SPI_BAUD_PCLK_DIV_16 = 4.5 MHz&#60;br /&#62;
    SPI1-&#38;gt;regs-&#38;gt;CR1 =  SPI_CR1_SPE &#124; SPI_BAUD_PCLK_DIV_32 &#124; SPI_FRAME_MSB &#124; SPI_DFF_8_BIT &#124; SPI_CR1_MSTR &#124; SPI_MODE_0;&#60;br /&#62;
    SPI1-&#38;gt;regs-&#38;gt;CR2 = SPI_CR2_SSOE;&#60;br /&#62;
    //enable&#60;br /&#62;
    spi_peripheral_enable(SPI1);&#60;br /&#62;
    //clear registers by reading them&#60;br /&#62;
    int clr = 0;&#60;br /&#62;
    clr = SPI1-&#38;gt;regs-&#38;gt;SR;&#60;br /&#62;
    clr = SPI1-&#38;gt;regs-&#38;gt;DR;&#60;br /&#62;
    clr = SPI1-&#38;gt;regs-&#38;gt;CR1;&#60;br /&#62;
    clr = SPI1-&#38;gt;regs-&#38;gt;CR2;&#60;br /&#62;
    //flush&#60;br /&#62;
    select();&#60;br /&#62;
    while((SPI1-&#38;gt;regs-&#38;gt;SR &#38;amp; SPI_SR_BSY) == SPI_SR_BSY);&#60;br /&#62;
    deselect();&#60;br /&#62;
}&#60;br /&#62;
* In &#34;_spi.c&#34;, the transfer function became:&#60;br /&#62;
byte SpiDevice::transfer(volatile byte data) {&#60;br /&#62;
    // Start the transmission&#60;br /&#62;
    SPI1-&#38;gt;regs-&#38;gt;DR = data;&#60;br /&#62;
    // Wait for the end of the transmission&#60;br /&#62;
    while((SPI1-&#38;gt;regs-&#38;gt;SR &#38;amp; SPI_SR_TXE) != SPI_SR_TXE);&#60;br /&#62;
    // Wait for the end of the reception&#60;br /&#62;
    while((SPI1-&#38;gt;regs-&#38;gt;SR &#38;amp; SPI_SR_RXNE) != SPI_SR_RXNE);&#60;br /&#62;
    // Return the received byte&#60;br /&#62;
    return (SPI1-&#38;gt;regs-&#38;gt;DR);&#60;br /&#62;
}&#60;br /&#62;
* i also had to rename the &#34;ring_buffer&#34; variable in parsedstream because it conflict with a maple variable.&#60;br /&#62;
* if debugging is activated (i.e ERROR_LEVEL &#38;gt; 0 in debug.h), think about replacing &#34;serial.print&#34; by &#34;SerialUSB.print&#34;)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>poslathian on "Recommand me a lipo battery"</title>
			<link>http://forums.leaflabs.com/topic.php?id=174#post-7562</link>
			<pubDate>Wed, 11 Jan 2012 12:16:03 +0000</pubDate>
			<dc:creator>poslathian</dc:creator>
			<guid isPermaLink="false">7562@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Natalie,&#60;br /&#62;
   I use 2000maH batteries all the time, the kind from sparkfun with the automatic voltage cutoffs. I recommend that style because Maple will continue to draw current even after you fall below the minimum voltage (~2.5V), thus draining your battery all the way to zero if you let it. This is not good for lipos as you know, and recovering from low voltage takes forever as the charger will trickle charge them back up (days). &#60;/p&#62;
&#60;p&#62;Anyway, the battery charger ostensibly only works with single cell batteries, because it tries to be smart about how it charges them. However, as long as you are using 3.7V (which actually have a nominal full voltage of 4.2) lipos you should be fine.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Natalie on "Recommand me a lipo battery"</title>
			<link>http://forums.leaflabs.com/topic.php?id=174#post-7506</link>
			<pubDate>Fri, 06 Jan 2012 04:36:18 +0000</pubDate>
			<dc:creator>Natalie</dc:creator>
			<guid isPermaLink="false">7506@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;What is the maximum capacity that can be used with the Maple?&#60;br /&#62;
For example, is it possible to use a 3.7V 2000mAH LiPo battery?&#60;br /&#62;
Or is it limited to less than 1000mAH?&#60;br /&#62;
Does the integrated LiPo battery charger can handle 2000mAH?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Natalie on "Display Shields"</title>
			<link>http://forums.leaflabs.com/topic.php?id=999#post-7189</link>
			<pubDate>Fri, 18 Nov 2011 09:31:12 +0000</pubDate>
			<dc:creator>Natalie</dc:creator>
			<guid isPermaLink="false">7189@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi,&#60;br /&#62;
I have a Wifly Shield, based on RN131, connected to a Maple board.&#60;br /&#62;
I download the corresponding library from &#60;a href=&#34;https://github.com/sparkfun/WiFly-Shield&#34; rel=&#34;nofollow&#34;&#62;https://github.com/sparkfun/WiFly-Shield&#60;/a&#62;&#60;br /&#62;
But it fails compiling the WiFly library because there is no &#34;pins_arduino.h&#34; file.&#60;br /&#62;
What is the corresponding header file for the Maple?&#60;br /&#62;
&#60;a href=&#34;http://leaflabs.com/docs/arduino-compatibility.html&#34; rel=&#34;nofollow&#34;&#62;http://leaflabs.com/docs/arduino-compatibility.html&#60;/a&#62; says the Wifi Shield is compatible.&#60;br /&#62;
Does anyone managed to run a Maple with Wifly Shield?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Tuning ADC to a specific sample rate (i.e. 8000Hz)"</title>
			<link>http://forums.leaflabs.com/topic.php?id=849#post-7162</link>
			<pubDate>Sat, 12 Nov 2011 20:53:26 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">7162@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;hbdgas - there is an ongoing development of SD access using DMA by polpla, see:&#60;br /&#62;
&#60;a href=&#34;http://forums.leaflabs.com/topic.php?id=112&#38;amp;page=5#post-6711&#34; rel=&#34;nofollow&#34;&#62;http://forums.leaflabs.com/topic.php?id=112&#38;amp;page=5#post-6711&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Edit: oops you already have :-)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>hbdgas on "Tuning ADC to a specific sample rate (i.e. 8000Hz)"</title>
			<link>http://forums.leaflabs.com/topic.php?id=849#post-7160</link>
			<pubDate>Sat, 12 Nov 2011 19:34:33 +0000</pubDate>
			<dc:creator>hbdgas</dc:creator>
			<guid isPermaLink="false">7160@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;gbulmer,&#60;/p&#62;
&#60;p&#62;Thank you for the quick response. I think I will try the external trigger. One more question, admittedly I am not a great programmer, and I was planning on using the SDFat library to do the SD writes. I do not think the library supports DMA at this time(I could be wrong). How hard is it to write to SD using DMA?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Tuning ADC to a specific sample rate (i.e. 8000Hz)"</title>
			<link>http://forums.leaflabs.com/topic.php?id=849#post-7156</link>
			<pubDate>Sat, 12 Nov 2011 16:22:35 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">7156@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;hbdgas - it is relatively straightforward to slow anything down by using a busy loop.&#60;/p&#62;
&#60;p&#62;If you want roughly a 16KHz sample rate, you could do something like:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;const unsigned usecs_duration = 1000000/16000;   // actually 62.5 usec, but this is integer division
//...

loop() {
    // ...
    unsigned now = micros();
    int val = analogueRead(pin);
    while ((micros()-usecs_duration) &#38;lt; now) ; /* do nothing */
    //...
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;This won't be very accurate though, because the amount of time is actually 62.5 usec (so almost 1% error), the micros() function doesn't take the same amount of time every time it is called, and there are concurrent interrupts stealing time. &#60;/p&#62;
&#60;p&#62;So a better approach would be to trigger the ADC conversion with a timer.&#60;br /&#62;
This is described in the manual RM0008 (from ST Micro) in section 11.7 &#34;Conversion on external trigger&#34;.&#60;br /&#62;
You could save the converted values to RAM with DMA, and move it to SD using DMA.&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62; The desired sampling rate is 16kHz, but I read earlier in this topic that the slowest sample time for the adc is equivalent to 50kHz.
&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;As you will have read in post &#60;a href=&#34;http://forums.leaflabs.com/topic.php?id=849#post-5140&#34; rel=&#34;nofollow&#34;&#62;http://forums.leaflabs.com/topic.php?id=849#post-5140&#60;/a&#62;&#60;br /&#62;
this adjustable sample time is primarily intended to ensure the electronics of the ADC gets an accurate sample of the input voltage. It is not really intended to be used to adjust the ADC to a specific sample rate, it is a bit too crude for that. Using this mechanism in this case would have the effect of blocking a program inside the &#60;code&#62;analogRead()&#60;/code&#62; function, unless you implemented that yourself. Blocking inside &#60;code&#62;analogRead()&#60;/code&#62; would just waste time that you might need to do some processing (though it is no more wasteful that the busy loop I wrote here).&#60;/p&#62;
&#60;p&#62;(full disclosure: I am not a member of LeafLabs staff.)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>hbdgas on "Tuning ADC to a specific sample rate (i.e. 8000Hz)"</title>
			<link>http://forums.leaflabs.com/topic.php?id=849#post-7154</link>
			<pubDate>Sat, 12 Nov 2011 15:10:45 +0000</pubDate>
			<dc:creator>hbdgas</dc:creator>
			<guid isPermaLink="false">7154@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I'm currently working on a school project that involves sampling audio data from a microphone and saving the data to a SD card. In order to give the CPU as much time as possible to write to the SD card, I'm considering using DMA. The desired sampling rate is 16kHz, but I read earlier in this topic that the slowest sample time for the adc is equivalent to 50kHz. Does anyone have any suggestions on how to slow the sampling rate further?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Tuning ADC to a specific sample rate (i.e. 8000Hz)"</title>
			<link>http://forums.leaflabs.com/topic.php?id=849#post-6232</link>
			<pubDate>Thu, 08 Sep 2011 20:36:30 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">6232@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;robodude666 - dump all the TIMER3 registers. There must be something different.&#60;/p&#62;
&#60;p&#62;I calculate as follows:&#60;br /&#62;
&#60;code&#62;uint32_t cycles = (uint32_t)(22.671f * (float)CYCLES_PER_MICROSECOND);&#60;/code&#62;&#60;br /&#62;
is 22.671 * 72 -&#38;gt; cycles is 1632&#60;br /&#62;
&#60;code&#62;uint16_t pre = (uint16_t)((cycles &#38;gt;&#38;gt; 16) + 1);&#60;/code&#62;&#60;br /&#62;
1632 &#38;gt;&#38;gt; 16 = 0, so pre is 1&#60;/p&#62;
&#60;p&#62;so&#60;br /&#62;
&#60;code&#62;timer_set_prescaler(TIMER3, pre);&#60;/code&#62; is &#60;code&#62;timer_set_prescaler(TIMER3, 1);&#60;/code&#62;&#60;br /&#62;
and&#60;br /&#62;
&#60;code&#62;Timer3.setPrescaleFactor(pre);&#60;/code&#62; is &#60;code&#62;Timer3.setPrescaleFactor(1);&#60;/code&#62;&#60;br /&#62;
In which case mbolivar's point would explain it. In one case the precscaler divides the clock by 1, and in the other, by 2.&#60;/p&#62;
&#60;p&#62;If you dump TIM3_PSC in both cases, it should be clear. (if that isn't the explanation, dump all the registers :-)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mbolivar on "Tuning ADC to a specific sample rate (i.e. 8000Hz)"</title>
			<link>http://forums.leaflabs.com/topic.php?id=849#post-6219</link>
			<pubDate>Thu, 08 Sep 2011 02:57:10 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">6219@http://forums.leaflabs.com/</guid>
			<description>&#60;blockquote&#62;&#60;p&#62;
With the same pre and cycles values as calculated above&#60;/p&#62;
&#60;/blockquote&#62;
&#60;p&#62;Careful!  timer.h uses prescaler values appropriate for writing to the PSC registers (i.e., 0-based).  HardwareTimer uses 1-based prescalers.&#60;/p&#62;
&#60;p&#62;Are you sure you're not off by one?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>robodude666 on "Tuning ADC to a specific sample rate (i.e. 8000Hz)"</title>
			<link>http://forums.leaflabs.com/topic.php?id=849#post-6199</link>
			<pubDate>Tue, 06 Sep 2011 11:59:50 +0000</pubDate>
			<dc:creator>robodude666</dc:creator>
			<guid isPermaLink="false">6199@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Sorry for the late response.&#60;/p&#62;
&#60;p&#62;I printed out the CR1 register using:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;Serial2.print(&#38;quot;CR1: &#38;quot;);
Serial2.println((TIMER3-&#38;gt;regs).bas-&#38;gt;CR1, HEX);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;and in both cases the CR1 register is set to 0x81. This configures the timer to be in up-count mode using edge-alignment.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
