<?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: External interrupts with multiplexed IRQs</title>
		<link>http://forums.leaflabs.com/topic.php?id=938</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:00: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=938" rel="self" type="application/rss+xml" />

		<item>
			<title>rogerclark on "External interrupts with multiplexed IRQs"</title>
			<link>http://forums.leaflabs.com/topic.php?id=938#post-105763</link>
			<pubDate>Thu, 23 Jul 2015 17:10:49 +0000</pubDate>
			<dc:creator>rogerclark</dc:creator>
			<guid isPermaLink="false">105763@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;It seems unlikely that you need to change the bootloader, as it is unloaded when the sketch runs.&#60;/p&#62;
&#60;p&#62;As the last posting to this thread was 3 years ago, I'd suggest you post to &#60;a href=&#34;http://www.stm32duino.com&#34; rel=&#34;nofollow&#34;&#62;http://www.stm32duino.com&#60;/a&#62; as its more active than this forum, and uses a derivative of libmaple
&#60;/p&#62;</description>
		</item>
		<item>
			<title>josemaes on "External interrupts with multiplexed IRQs"</title>
			<link>http://forums.leaflabs.com/topic.php?id=938#post-105739</link>
			<pubDate>Mon, 25 May 2015 06:08:45 +0000</pubDate>
			<dc:creator>josemaes</dc:creator>
			<guid isPermaLink="false">105739@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi mbolivar,&#60;/p&#62;
&#60;p&#62;do I need to recompile the bootloader to apply the patch?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>anton on "External interrupts with multiplexed IRQs"</title>
			<link>http://forums.leaflabs.com/topic.php?id=938#post-5880</link>
			<pubDate>Wed, 03 Aug 2011 23:12:55 +0000</pubDate>
			<dc:creator>anton</dc:creator>
			<guid isPermaLink="false">5880@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Happy to hear. I had the same problem.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ridgebackred on "External interrupts with multiplexed IRQs"</title>
			<link>http://forums.leaflabs.com/topic.php?id=938#post-5878</link>
			<pubDate>Wed, 03 Aug 2011 22:13:56 +0000</pubDate>
			<dc:creator>ridgebackred</dc:creator>
			<guid isPermaLink="false">5878@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;mbolivar,&#60;/p&#62;
&#60;p&#62;Yes, that update of exti.c fixed the multiplexed EXTI IRQ issue for me!&#60;/p&#62;
&#60;p&#62;The pulse duration of all six channels of the RC receiver are now captured correctly using the external interrupt capability of the Maple Mini.&#60;/p&#62;
&#60;p&#62;Thanks!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ridgebackred on "External interrupts with multiplexed IRQs"</title>
			<link>http://forums.leaflabs.com/topic.php?id=938#post-5876</link>
			<pubDate>Wed, 03 Aug 2011 18:04:55 +0000</pubDate>
			<dc:creator>ridgebackred</dc:creator>
			<guid isPermaLink="false">5876@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Thanks mbolivar!&#60;/p&#62;
&#60;p&#62;The Maple Mini: $34.99&#60;/p&#62;
&#60;p&#62;Having LeafLabs expertise brought to bear on an issue: Priceless
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mbolivar on "External interrupts with multiplexed IRQs"</title>
			<link>http://forums.leaflabs.com/topic.php?id=938#post-5874</link>
			<pubDate>Wed, 03 Aug 2011 16:49:38 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">5874@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;OK, I've pushed what should be a fix; see this bugtracker comment for more details:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://code.google.com/p/leaflabs/issues/detail?id=77#c2&#34; rel=&#34;nofollow&#34;&#62;http://code.google.com/p/leaflabs/issues/detail?id=77#c2&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Let me know if it resolves the issue on your tricopter/quadcopter.&#60;/p&#62;
&#60;p&#62;The fix went in as part of the following series of commits (now merged into master), which should also bring some other bugfixes and performance improvements to exti.c:&#60;/p&#62;
&#60;p&#62;c0750411002ce61a0df96aefd385106c2fc2b509 exti.c: Optimize multiplexed IRQ handlers.&#60;br /&#62;
487a60946d89f340982e4435d7ededaea1a09468 exti.c: Cleanups.&#60;br /&#62;
aee5bceb0f773826627543199de4332b2e36ba4a exti.c: Remove enable_irq() and maybe_disable_irq().&#60;br /&#62;
5a7ad93ab24cac998cc498aadb7e32cc29b836de exti.c: Clean up some bit-banding usages.&#60;br /&#62;
f5935ef4778aa081c7a22e1d3bfd0aadc7a213e2 exti.c: Cleanups.&#60;/p&#62;
&#60;p&#62;If you notice any other improvements or regressions, we'd love some feedback.&#60;/p&#62;
&#60;p&#62;Edit:  Here's the compare view on those commits:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;https://github.com/leaflabs/libmaple/compare/dab7dd44...c075041&#34; rel=&#34;nofollow&#34;&#62;https://github.com/leaflabs/libmaple/compare/dab7dd44...c075041&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mbolivar on "External interrupts with multiplexed IRQs"</title>
			<link>http://forums.leaflabs.com/topic.php?id=938#post-5873</link>
			<pubDate>Wed, 03 Aug 2011 16:30:17 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">5873@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I have reproduced the issue.  IRQs that are shared between several EXTI lines do appear to get dropped on the floor if a non-multiplexed EXTI IRQ is triggered at the same time.&#60;/p&#62;
&#60;p&#62;Since I don't have access to your sensors, I've added a new (non-portable and Maple Mini specific, ATM) test of external interrupts which only requires wires:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;https://github.com/leaflabs/libmaple/blob/master/examples/mini-exti-test.cpp&#34; rel=&#34;nofollow&#34;&#62;https://github.com/leaflabs/libmaple/blob/master/examples/mini-exti-test.cpp&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;See the file header for a way to wire it up.&#60;/p&#62;
&#60;p&#62;Bugtracker reference, with expected and actual output:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://code.google.com/p/leaflabs/issues/detail?id=77&#34; rel=&#34;nofollow&#34;&#62;http://code.google.com/p/leaflabs/issues/detail?id=77&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I'll try to sort out what's going on.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ridgebackred on "External interrupts with multiplexed IRQs"</title>
			<link>http://forums.leaflabs.com/topic.php?id=938#post-5861</link>
			<pubDate>Tue, 02 Aug 2011 22:07:30 +0000</pubDate>
			<dc:creator>ridgebackred</dc:creator>
			<guid isPermaLink="false">5861@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;mbolivar,&#60;/p&#62;
&#60;p&#62;I have 2 MapleMini's flying in my tricopter and quadcopter since the MapleMini's went on sale. Lots of fun! The MapleMini's are great controllers. I had my doubts about using high clock speed controllers in an environment as electrically noisy as RC models. The MapleMini's are holding up very well in a demanding application.&#60;/p&#62;
&#60;p&#62;Four RC channels are all that is required for basic flying.&#60;br /&#62;
Additional channels are for mode selection and trying out new control schemes in flight.&#60;/p&#62;
&#60;p&#62;My &#34;real-time&#34; debug method is limited to blinking the led from different parts of the code, and looking at the led output with an o-scope.&#60;/p&#62;
&#60;p&#62;It seems like a AFIO_EXTI_5 handler and higher is being blocked by something.&#60;br /&#62;
I have eliminated the RX signal itself as the cause by switching RX channels 4 and 5 of the receiver to the MapleMini inputs. The 'missed/late interrupt' stays with EXTI 5 (and higher) pin(s).&#60;/p&#62;
&#60;p&#62;Interrupt capture is rock solid for EXTI 0 through 4.&#60;/p&#62;
&#60;p&#62;A functional program is at: &#60;a href=&#34;http://snipt.net/ridgebackred/mapleminiquad0002apde&#34; rel=&#34;nofollow&#34;&#62;http://snipt.net/ridgebackred/mapleminiquad0002apde&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;A photo about half way down the page of the MapleMini.&#60;br /&#62;
&#60;a href=&#34;http://aeroquad.com/showthread.php?3614-3D-printed-motor-mounts-for-aluminum-airfoil-arms/page3&#34; rel=&#34;nofollow&#34;&#62;http://aeroquad.com/showthread.php?3614-3D-printed-motor-mounts-for-aluminum-airfoil-arms/page3&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mbolivar on "External interrupts with multiplexed IRQs"</title>
			<link>http://forums.leaflabs.com/topic.php?id=938#post-5850</link>
			<pubDate>Tue, 02 Aug 2011 15:14:38 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">5850@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;ridgebackred,&#60;/p&#62;
&#60;p&#62;can we see your entire program, or get some more details on what you mean by the following:&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;
Inputs AFIO_EXTI_5 and above all seem to drop to a lower interrupt priority. Interrupt servicing for the multiplexed handlers is not consistent.
&#60;/p&#62;&#60;/blockquote&#62;</description>
		</item>
		<item>
			<title>ridgebackred on "External interrupts with multiplexed IRQs"</title>
			<link>http://forums.leaflabs.com/topic.php?id=938#post-5792</link>
			<pubDate>Fri, 29 Jul 2011 12:10:48 +0000</pubDate>
			<dc:creator>ridgebackred</dc:creator>
			<guid isPermaLink="false">5792@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Thanks robodude666,&#60;/p&#62;
&#60;p&#62;This is the code snip.  It's repeated for each handler. Unless the micros() function is taking much longer than I realize, I should be in-n-out of the handlers plenty fast enough not to miss any.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;void handler_CH1(void) {               // Measure RX Pitch duration
    if(Chan1begin == 0){               // Rising edge interrupt signal
     Chan1begin = micros();
     Chan1prev = RxInPitch;
    }
    else{                              // Falling edge interrupt signal
     Chan1end = micros();
     RxInPitch = Chan1end - Chan1begin;
     if((RxInPitch &#38;lt; 1000) &#124;&#124; (RxInPitch &#38;gt; 2000)) //Glitch suppression
     {RxInPitch = Chan1prev; Chan1end = 0;}
     RxInPitchSmooth =(RxInPitchSmooth + RxInPitch) / 2;
     Chan1begin = 0;
    }
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>robodude666 on "External interrupts with multiplexed IRQs"</title>
			<link>http://forums.leaflabs.com/topic.php?id=938#post-5791</link>
			<pubDate>Fri, 29 Jul 2011 11:33:45 +0000</pubDate>
			<dc:creator>robodude666</dc:creator>
			<guid isPermaLink="false">5791@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;There may be two explanations for this:&#60;/p&#62;
&#60;p&#62;1) All interrupts are configured for the lowest possible priority. If you adjust the priority of 0 - 4, they &#60;em&#62;will&#60;/em&#62; operate at a higher priority level.&#60;/p&#62;
&#60;p&#62;2) EXTI 0 through 4 have their own irq line. 5-9 and 10-15 respectively share the same IRQ line and interrupt handlers.&#60;/p&#62;
&#60;p&#62;If an interrupt for 5 through 9 is received, it goes through more code to determine which of the five interrupts could have been triggered. This takes more time and creates a delay.&#60;/p&#62;
&#60;p&#62;You can view the &#60;a href=&#34;https://github.com/leaflabs/libmaple/blob/master/libmaple/exti.c&#34;&#62;libmaple/exti.c&#60;/a&#62; file yourself to see how the implementation actually works to understand where these delays come from. This implementation is based on STM's design, and not some weird setup LeafLabs decided on.&#60;/p&#62;
&#60;p&#62;-robodude666
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ridgebackred on "External interrupts with multiplexed IRQs"</title>
			<link>http://forums.leaflabs.com/topic.php?id=938#post-5790</link>
			<pubDate>Fri, 29 Jul 2011 11:20:53 +0000</pubDate>
			<dc:creator>ridgebackred</dc:creator>
			<guid isPermaLink="false">5790@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I hesitate to call this a bug, but I am seeing repeatable results when staying in the userspace code area...&#60;/p&#62;
&#60;p&#62;My setup is a six channel RC receiver with the outputs connected to the MapleMini.&#60;/p&#62;
&#60;p&#62;All inputs to the MapleMini are used as external interrupts. Care has been taken not to violate the multiplexed interrupt pin assignment rules.&#60;/p&#62;
&#60;p&#62;AFIO_EXTI_0 through AFIO_EXTI_4 work fine.&#60;br /&#62;
Inputs AFIO_EXTI_5 and above all seem to drop to a lower interrupt priority. Interrupt servicing for the multiplexed handlers is not consistent.&#60;/p&#62;
&#60;p&#62;Ideas?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
