<?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: interrupts taking too long a time</title>
		<link>http://forums.leaflabs.com/topic.php?id=1049</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:24:16 +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=1049" rel="self" type="application/rss+xml" />

		<item>
			<title>robodude666 on "interrupts taking too long a time"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1049#post-6403</link>
			<pubDate>Tue, 20 Sep 2011 10:00:50 +0000</pubDate>
			<dc:creator>robodude666</dc:creator>
			<guid isPermaLink="false">6403@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Please refer to my latest comment in that &#60;a href=&#34;http://forums.leaflabs.com/topic.php?id=834&#34;&#62;thread&#60;/a&#62;. I discussed it a little bit.&#60;/p&#62;
&#60;p&#62;Please note that this is probably the worst way of outputting a square wave. Each timer is associated with a hardware GPIO and can be setup in PWM mode to generate a signal at the GPIO. Refer to the &#60;a href=&#34;http://leaflabs.com/docs/lang/api/hardwaretimer.html#lang-hardwaretimer&#34;&#62;HardwareTimer&#60;/a&#62; docs about setting the mode of a timer to PWM.&#60;/p&#62;
&#60;p&#62;While the libmaple and wirish functions, classes, and methods are written to be as fast as possible, they still cumulate a lot of overhead. The timer interrupts have their own overhead, the togglePin function calls other wirish functions which have their own overhead, and so forth. Ultimately you'll see that 150kHz is the best you can do with them. To get better performance -- performance that the STM32 is more than capable of -- you'll have to look at the hardware and use it to your advantage.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gulu2065 on "interrupts taking too long a time"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1049#post-6397</link>
			<pubDate>Mon, 19 Sep 2011 17:45:06 +0000</pubDate>
			<dc:creator>gulu2065</dc:creator>
			<guid isPermaLink="false">6397@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I want to use this to generate a 1.6Mhz frequency.&#60;br /&#62;
However, I can't get that high. I can only racy 150khz.Here is my code.&#60;/p&#62;
&#60;p&#62;#include &#38;lt;timer.h&#38;gt;&#60;/p&#62;
&#60;p&#62;void setup() {&#60;br /&#62;
  SerialUSB.end();&#60;br /&#62;
  systick_disable();&#60;/p&#62;
&#60;p&#62;  pinMode(0, OUTPUT);&#60;/p&#62;
&#60;p&#62;  digitalWrite(0, LOW);&#60;/p&#62;
&#60;p&#62;  timer_pause(TIMER1);&#60;br /&#62;
  timer_set_mode(TIMER1, TIMER_CH1, TIMER_OUTPUT_COMPARE);&#60;br /&#62;
  timer_set_prescaler(TIMER1, 1);&#60;br /&#62;
  timer_set_reload(TIMER1, 72);&#60;br /&#62;
  timer_set_compare(TIMER1, TIMER_CH1, 1);&#60;br /&#62;
  timer_attach_interrupt(TIMER1, TIMER_CH1, handler1);&#60;br /&#62;
  timer_generate_update(TIMER1);&#60;br /&#62;
  timer_resume(TIMER1);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;void handler1() {&#60;br /&#62;
togglePin (24);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;I notice someone discuss here&#60;br /&#62;
&#60;a href=&#34;http://forums.leaflabs.com/topic.php?id=834#post-4977&#34; rel=&#34;nofollow&#34;&#62;http://forums.leaflabs.com/topic.php?id=834#post-4977&#60;/a&#62;&#60;br /&#62;
I think what robodude666 said could solve my problem.(&#34;checkout the source behind the timer's interrupt handlers&#34;) But I don't know how to do it.&#60;br /&#62;
Could anyone told me how to do it?&#60;br /&#62;
I am really green hand to this area.&#60;br /&#62;
Thanks,
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
