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

		<item>
			<title>Feyr on "ARM acronyms somewhere"</title>
			<link>http://forums.leaflabs.com/topic.php?id=99#post-604</link>
			<pubDate>Thu, 22 Jul 2010 23:49:36 +0000</pubDate>
			<dc:creator>Feyr</dc:creator>
			<guid isPermaLink="false">604@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;i honestly haven't looked at intregrating it to wirish yet. i barely looked at the timers branch. that will probably take a while as my C is seriously rusty&#60;/p&#62;
&#60;p&#62;there's a couple limitation with my current code&#60;/p&#62;
&#60;p&#62;-in my case, since the dynamic range is so high the timer roll over and i don't think i can merge two timers to make a 32 bit (because the SMC is already used). this might need to be addressed in an interrupt.i haven't looked at implementing those yet&#60;/p&#62;
&#60;p&#62;- CCR1 and CCR2 seem to be swapped from what the ref manual say they should be. so it might not be measuring exactly what i think it's measuring (i sense more scope debugging this weekend ): CCR1 is the one moving in response to changes in distance, when it's CCR2 that should be&#60;br /&#62;
-the code you commented on isn't the &#34;working&#34; version, for some reason github hasn't updated it yet.&#60;/p&#62;
&#60;p&#62;what's wrong with twiddling registers in a sketch? :) *mumbles something about 100 lines vimrc*
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bnewbold on "ARM acronyms somewhere"</title>
			<link>http://forums.leaflabs.com/topic.php?id=99#post-603</link>
			<pubDate>Thu, 22 Jul 2010 23:09:19 +0000</pubDate>
			<dc:creator>bnewbold</dc:creator>
			<guid isPermaLink="false">603@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Wow, super awesome! Great to see others twiddling register bits, especially from a sketch!&#60;/p&#62;
&#60;p&#62;Do you have any thoughts on how this functionality could be integrated with the new Timers library? (see &#60;a href=&#34;http://leaflabs.com/docs/maple/timers/&#34; rel=&#34;nofollow&#34;&#62;http://leaflabs.com/docs/maple/timers/&#60;/a&#62; )&#60;/p&#62;
&#60;p&#62;Maybe something like&#60;/p&#62;
&#60;p&#62;Timer1.setChannel1Mode(TIMERS_PULSEIN);&#60;br /&#62;
Timer1.readPulseMicros();&#60;br /&#62;
Timer1.readPulseMillis();
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Feyr on "ARM acronyms somewhere"</title>
			<link>http://forums.leaflabs.com/topic.php?id=99#post-602</link>
			<pubDate>Thu, 22 Jul 2010 22:27:03 +0000</pubDate>
			<dc:creator>Feyr</dc:creator>
			<guid isPermaLink="false">602@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;well, i am happy to announce that i have finally gotten the input capture to work. the offending line in the reference manual was this:&#60;/p&#62;
&#60;p&#62;Note: CC1S bits are writable only when the channel is OFF (CC1E = 0 in TIMx_CCER).&#60;/p&#62;
&#60;p&#62;and i wrongly assumed everything was OFF right after bootup.&#60;/p&#62;
&#60;p&#62;i will leave the code in github for future reference. now to package that in a useful way. refspec 5df13e743ee57150254998c8c7887afcb925662f
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Feyr on "ARM acronyms somewhere"</title>
			<link>http://forums.leaflabs.com/topic.php?id=99#post-600</link>
			<pubDate>Thu, 22 Jul 2010 17:37:47 +0000</pubDate>
			<dc:creator>Feyr</dc:creator>
			<guid isPermaLink="false">600@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;hey perry, if you still plan on taking a look, i made a github repo to document my trials&#60;/p&#62;
&#60;p&#62;git://github.com/Feyr/PWM_Capture.git
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Feyr on "ARM acronyms somewhere"</title>
			<link>http://forums.leaflabs.com/topic.php?id=99#post-573</link>
			<pubDate>Mon, 19 Jul 2010 06:53:58 +0000</pubDate>
			<dc:creator>Feyr</dc:creator>
			<guid isPermaLink="false">573@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;it's a pulse back from an ultrasonic sensor from seeedstudio (&#60;a href=&#34;http://www.seeedstudio.com/depot/datasheet/Seeed%20Ultrasonic%20Sensor%20datasheet.pdf&#34; rel=&#34;nofollow&#34;&#62;http://www.seeedstudio.com/depot/datasheet/Seeed%20Ultrasonic%20Sensor%20datasheet.pdf&#60;/a&#62;)&#60;br /&#62;
basicly i need to emulate the pulseIn() from Wiring, but in a better way. later i might use the interrupt function but i'd settle for just getting it working for now&#60;/p&#62;
&#60;p&#62;to use the sensor, first i set the pin to output mode, send a 10us pulse and then switch back to input to read the distance as the pulse width&#60;/p&#62;
&#60;p&#62;my code looks like this so far, it's not very friendly but it makes for easy(er) tweaking:&#60;/p&#62;
&#60;p&#62;rcc_enable_clk_timer2();&#60;br /&#62;
Timer* timer2=  (Timer*)TIMER2_BASE;&#60;br /&#62;
timer2-&#38;gt;CR2 = BIT(7) ;&#60;br /&#62;
// set CCMR1 CC1S to 01 (set active input TI1)&#60;br /&#62;
/// 01: CC1 channel is configured as input, IC1 is mapped on TI1.&#60;br /&#62;
timer2-&#38;gt;CCMR1 &#38;amp;= ~BIT(1);&#60;br /&#62;
timer2-&#38;gt;CCMR1 &#124;= BIT(0);&#60;br /&#62;
// set CCMR1 CC2S to 10 (set active input TI1)&#60;br /&#62;
///  10: CC2 channel is configured as input, IC2 is mapped on TI1&#60;br /&#62;
timer2-&#38;gt;CCMR1 &#124;= BIT(9);&#60;br /&#62;
timer2-&#38;gt;CCMR1 &#38;amp;= ~BIT(8);&#60;/p&#62;
&#60;p&#62;// select the active polarity on TI1FP1. write CC1P to 0 (active on rising edge)&#60;br /&#62;
///0: non-inverted: capture is done on a rising edge of IC1.&#60;br /&#62;
timer2-&#38;gt;CCER &#38;amp;= ~BIT(5);&#60;br /&#62;
// select the active polarity on TI1FP2. write CC2P to 1 (active on falling edge)&#60;br /&#62;
///1: inverted: capture is done on a falling edge of IC1&#60;br /&#62;
timer2-&#38;gt;CCER &#124;= BIT(1)  ;&#60;/p&#62;
&#60;p&#62;//select valid trigger input: write TS to 101 in SMCR (Slave Mode Config Register). meaning we should reset when TI1 triggers&#60;br /&#62;
/// 101: Filtered Timer Input 1 (TI1FP1)&#60;br /&#62;
timer2-&#38;gt;SMCR &#124;= BIT(6) &#124; BIT(4) ;&#60;br /&#62;
timer2-&#38;gt;SMCR &#38;amp;= ~BIT(5);&#60;/p&#62;
&#60;p&#62;// write SMS to 100 in SMCR: slave controller in reset mode&#60;br /&#62;
///100: Reset Mode - Rising edge of the selected trigger input (TRGI) reinitializes the counter and generates an update of the registers&#60;br /&#62;
timer2-&#38;gt;SMCR &#38;amp;= ~BIT(1) ;&#60;br /&#62;
//timer2-&#38;gt;SMCR &#38;amp;= ~BIT(0);&#60;br /&#62;
timer2-&#38;gt;SMCR &#124;= BIT(0);&#60;br /&#62;
timer2-&#38;gt;SMCR &#124;= BIT(2);&#60;/p&#62;
&#60;p&#62;timer2-&#38;gt;CR1&#124;=BIT(9)&#38;amp;BIT(8);&#60;/p&#62;
&#60;p&#62;// enable the CC channels&#60;br /&#62;
timer2-&#38;gt;CCER &#124;= (BIT0 &#124; BIT4);&#60;/p&#62;
&#60;p&#62;// send a pulse&#60;br /&#62;
  pinMode(pingPin, OUTPUT);&#60;br /&#62;
  digitalWrite(pingPin, LOW); // ensure it is pulled low&#60;br /&#62;
  delayMicroseconds(2);&#60;br /&#62;
  digitalWrite(pingPin, HIGH);&#60;br /&#62;
  delayMicroseconds(10);&#60;br /&#62;
  digitalWrite(pingPin, LOW);&#60;br /&#62;
  delayMicroseconds(2);&#60;br /&#62;
  pinMode(pingPin, INPUT);&#60;/p&#62;
&#60;p&#62;// wait 40 ms, spec say the pulse will never be wider than 35ms if there are no obstacle within 4meters&#60;br /&#62;
  delay(40);&#60;/p&#62;
&#60;p&#62;////&#60;/p&#62;
&#60;p&#62;after that we should in theory have the period and duty cycle in timer2-&#38;gt;CCR1 and timer2-&#38;gt;CCR2. i tried various things over the weekend: enabling the counter and tweaking registers but as bnewbold said, i'm probably missing an initialisation somewhere
&#60;/p&#62;</description>
		</item>
		<item>
			<title>perry on "ARM acronyms somewhere"</title>
			<link>http://forums.leaflabs.com/topic.php?id=99#post-569</link>
			<pubDate>Sun, 18 Jul 2010 22:50:51 +0000</pubDate>
			<dc:creator>perry</dc:creator>
			<guid isPermaLink="false">569@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;hi feyr,&#60;/p&#62;
&#60;p&#62;what sort of input signal are you trying to measure and what features do you need? i haven't played with the input capture at all but i can take a look and see if i can play with them a bit this weekend.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bnewbold on "ARM acronyms somewhere"</title>
			<link>http://forums.leaflabs.com/topic.php?id=99#post-565</link>
			<pubDate>Sat, 17 Jul 2010 13:18:05 +0000</pubDate>
			<dc:creator>bnewbold</dc:creator>
			<guid isPermaLink="false">565@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I just re-pushed the i2c branch, not sure how it got deleted from github. I rebased it to master recently but didn't test after that so YMMV
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Feyr on "ARM acronyms somewhere"</title>
			<link>http://forums.leaflabs.com/topic.php?id=99#post-564</link>
			<pubDate>Fri, 16 Jul 2010 16:52:12 +0000</pubDate>
			<dc:creator>Feyr</dc:creator>
			<guid isPermaLink="false">564@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;hah great thanks! i found some of what i was looking for this morning, and this should help fill the gaps. i'll try to take some notes and submit some code once i get it working&#60;/p&#62;
&#60;p&#62;one more thing, the doc (&#60;a href=&#34;http://leaflabs.com/docs/maple/i2c/&#34; rel=&#34;nofollow&#34;&#62;http://leaflabs.com/docs/maple/i2c/&#60;/a&#62;) refers to an &#34;i2c&#34; branch on github for libmaple but it doesn't seem to have been pushed. is it completly broken or just an oversight?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bnewbold on "ARM acronyms somewhere"</title>
			<link>http://forums.leaflabs.com/topic.php?id=99#post-562</link>
			<pubDate>Fri, 16 Jul 2010 13:06:36 +0000</pubDate>
			<dc:creator>bnewbold</dc:creator>
			<guid isPermaLink="false">562@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi Feyr!&#60;/p&#62;
&#60;p&#62;Welcome to the joys of STM32 reference documentation! The register names (like CCER) are pretty confusing; they aren't &#34;real&#34; acronyms, just short variable names. I usually open a couple copies of that giant PDF and search the table of contents to look up register names. Eg, CCER is probably&#60;/p&#62;
&#60;pre&#62;
13.4.9 TIM1&#38;amp;TIM8 capture/compare enable register (TIMx_CCER) . . . . . . . 311
&#60;/pre&#62;
&#60;p&#62;If you find a better solution i'd love to hear it! Writing all this us would be a great project, if I had another day a week i'd spend it filling in bildr.org with this sort of information.&#60;/p&#62;
&#60;p&#62;I'm just wrapping up the basic timer implementation and i'm guessing that the advanced timer input stuff will be non-trivial. In the end it probably isn't too complicated, but the reference documentation takes a very, very long time to process, as there isn't always a summary of how registers should be configured to accomplish a given task, so you don't know if you're missing some peripheral configuration step until it all works. Using a timer instead of SysTick is probably the way to go; the basic timers have PWM input functionality, so i'd recommend using Timer4 instead of Timer1 (advanced) as it has fewer conflicts with other peripherals. &#60;/p&#62;
&#60;p&#62;The ./notes/pin-mapping.txt file in libmaple has a table of Maple-header to STM32-pin plus functionality; this really needs to get integrated into the docs! Geeze!&#60;br /&#62;
&#60;a href=&#34;http://github.com/leaflabs/libmaple/blob/master/notes/pin-mapping.txt&#34; rel=&#34;nofollow&#34;&#62;http://github.com/leaflabs/libmaple/blob/master/notes/pin-mapping.txt&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;You might also find these rough notes on the timer interrupts useful as general context:&#60;br /&#62;
&#60;a href=&#34;http://github.com/leaflabs/libmaple/blob/timers/notes/timers.txt&#34; rel=&#34;nofollow&#34;&#62;http://github.com/leaflabs/libmaple/blob/timers/notes/timers.txt&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I believe TIM1_CH1N is the negative of TIM1_CH1? Page 340/1003 of the reference manual has a summary of what needs to be done.  I recommend hacking these steps into a new function in ./libmaple/timers.c to work out all the kinks, then rewriting everything more cleanly once you understand it. If you send me code for a working PWM implementation i'd love to integrate it as a feature into libmaple; having working code in hand that can be disassembled and tested against is 90% of the battle!&#60;/p&#62;
&#60;p&#62;We're glad to hear you're digging in and would like to help as much as possible; post more questions!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Feyr on "ARM acronyms somewhere"</title>
			<link>http://forums.leaflabs.com/topic.php?id=99#post-560</link>
			<pubDate>Thu, 15 Jul 2010 22:45:34 +0000</pubDate>
			<dc:creator>Feyr</dc:creator>
			<guid isPermaLink="false">560@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hello! i'm rather new to ARMs chip and wondering if someone has some links to solve my problems.&#60;/p&#62;
&#60;p&#62;first off, is there a list of the acronyms definitions somewhere? i'm reading the stm32 reference manual and not much of it make sense to me. ie, what's a TI1 or a TI1FP? or a CCER?&#60;br /&#62;
maybe it's in a manual somewhere, but i haven't found it.&#60;/p&#62;
&#60;p&#62;to get down and dirty, im trying to use the PWM Input mode of the advanced timers to get the pulse width from an ultrasonic sensor. i tried messing with the systick timer (not precise enough or im being completly brain dead): the counter seem to wrap just from the overhead of reading the memory address. &#60;/p&#62;
&#60;p&#62;i haven't found much informations about pwm input, much less for the leaf. from reading the ref manual i'm under the impression i have to be on a few very specific gpio pins, is that right? something like TIM1_CH1N (what's the N for?), which is also called PA6 and pin 22. &#60;/p&#62;
&#60;p&#62;is there a reference somewhere that describe which gpio pin that maps to on the leaf? or is that a case of RTFS (read the ... schematic)?&#60;/p&#62;
&#60;p&#62;sorry for the dumb questions and imprecisions
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
