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

		<item>
			<title>cmartin on "Boot Procedure"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10055#post-21924</link>
			<pubDate>Tue, 08 Jan 2013 15:07:26 +0000</pubDate>
			<dc:creator>cmartin</dc:creator>
			<guid isPermaLink="false">21924@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;When the board resets the pins go high impedance, depending on your motor driver this could cause the motor to turn on.  As a simple check, put a 10KΩ resistor from the pin in question to ground.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>richiereynolds on "Boot Procedure"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10055#post-21918</link>
			<pubDate>Tue, 08 Jan 2013 08:43:56 +0000</pubDate>
			<dc:creator>richiereynolds</dc:creator>
			<guid isPermaLink="false">21918@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi there, I have 2 motors running off pwm from an olimexino maple clone. The motors are connected to pins D0/1/2 and D3/4/5 with D0 and D3 being the pwm pins, the others the Hi/Lo to specify direction.&#60;/p&#62;
&#60;p&#62;If I reset the maple it goes through some sort of boot procedure before my program starts. One of the motors goes into full throttle for the duration of the boot which is several seconds. (Sorry, not near my board so not sure which one) I guess the boot procedure must write high to some of those pins. Anyone know if there's a way to stop this?&#60;/p&#62;
&#60;p&#62;Thanks!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>phisatho on "SPI Interrups"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1483#post-9862</link>
			<pubDate>Fri, 23 Mar 2012 15:14:22 +0000</pubDate>
			<dc:creator>phisatho</dc:creator>
			<guid isPermaLink="false">9862@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Shouldn't this be added to Wiki?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>richiereynolds on "SPI Interrups"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1483#post-9840</link>
			<pubDate>Tue, 20 Mar 2012 15:15:25 +0000</pubDate>
			<dc:creator>richiereynolds</dc:creator>
			<guid isPermaLink="false">9840@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Thankyou &#60;strong&#62;very&#60;/strong&#62; much, works a treat!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mbolivar on "SPI Interrups"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1483#post-9837</link>
			<pubDate>Tue, 20 Mar 2012 02:25:00 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">9837@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;hi,&#60;/p&#62;
&#60;p&#62;calling &#60;code&#62;spi_irq_enable()&#60;/code&#62; as you have done enables both the interrupt line (in the NVIC) and the SPI RX not empty interrupt. however, the vector table entry for SPI2 doesn't point to anything useful by default, as libmaple doesn't (currently) provide an interrupt handler for the SPI peripherals. as you guessed, you need to register an interrupt handler yourself. you can do this by declaring a function named &#60;code&#62;__irq_spi2&#60;/code&#62;, with C linkage, like so:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;extern &#38;quot;C&#38;quot; void __irq_spi2(void) {
    // your SPI2 handler code goes here
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;the linker looks for a function with this name, and will cause it to be used as the SPI2 IRQ handler if it's defined. note that the extern &#34;C&#34; is mandatory -- you must give this function C linkage, or its name will go through C++ name mangling, and the linker won't pick up on it.&#60;/p&#62;
&#60;p&#62;hope this helps!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>richiereynolds on "SPI Interrups"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1483#post-9186</link>
			<pubDate>Sat, 17 Mar 2012 06:48:12 +0000</pubDate>
			<dc:creator>richiereynolds</dc:creator>
			<guid isPermaLink="false">9186@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hello, I'm using the maple as a slave SPI receiver. I want to trigger an interrupt routine when data is received but can't quite work out how to do it, can anyone help?&#60;/p&#62;
&#60;p&#62;I've done this:&#60;br /&#62;
&#60;code&#62;&#60;br /&#62;
HardwareSPI(2) spi;&#60;br /&#62;
setup()&#60;br /&#62;
{&#60;br /&#62;
    spi.beginSlave();&#60;br /&#62;
    spi_irq_enable(SPI2, SPI_RXNE_INTERRUPT);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;void handleSpi()&#60;br /&#62;
{&#60;br /&#62;
    byte b = spi.read();&#60;br /&#62;
    ...&#60;br /&#62;
}&#60;br /&#62;
&#60;/code&#62;&#60;br /&#62;
So my question is how do I set up my &#60;code&#62;handleSpi&#60;/code&#62; as the interrupt handler?&#60;br /&#62;
In the header files I've traced through and found that the &#60;code&#62;nvic_irq_num&#60;/code&#62; for SPI2 is &#60;code&#62;NVIC_SPI2 = 36&#60;/code&#62; but I don't know how to use that to set up an interrupt. Is that even relevant?&#60;/p&#62;
&#60;p&#62;Thanks for any help!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
