<?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: Using another microcontroller (Arduino?) as an oscilloscope.</title>
		<link>http://forums.leaflabs.com/topic.php?id=722</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:18: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?topic=722" rel="self" type="application/rss+xml" />

		<item>
			<title>Silntknight on "Using another microcontroller (Arduino?) as an oscilloscope."</title>
			<link>http://forums.leaflabs.com/topic.php?id=722#post-4240</link>
			<pubDate>Fri, 08 Apr 2011 13:08:37 +0000</pubDate>
			<dc:creator>Silntknight</dc:creator>
			<guid isPermaLink="false">4240@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Ok! Let me know if you uncover anything!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Using another microcontroller (Arduino?) as an oscilloscope."</title>
			<link>http://forums.leaflabs.com/topic.php?id=722#post-4236</link>
			<pubDate>Fri, 08 Apr 2011 04:57:35 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">4236@http://forums.leaflabs.com/</guid>
			<description>&#60;blockquote&#62;&#60;p&#62;... I was wondering about is mostly how to get the most accurate timing possible over a certain time span&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;User Time/Counter1 in 16-bit mode, rather than the 8-bit mode setup by the Arduino's normal initialisation. There is probably a reasonable amount about it on the 'net, but I might be able to dig out old code to set it up if you get stuck.&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;I intend to use the prescaler to generate a square wave at a particular frequency. The actual pulse-width is irrelevant as the Maple only cares about the rising change. &#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;I think some of the ATmega &#34;wave-generation&#34; modes may be more helpful than the default PWM mode for this. In PWM mode, the compare register is used to adjust the PWM duty cycle, in other modes it is used to set the range of counting, so you can adjust the frequency.&#60;/p&#62;
&#60;p&#62;Good luck!&#60;br /&#62;
(full disclosure: I am not a member of the LeafLabs staff)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Silntknight on "Using another microcontroller (Arduino?) as an oscilloscope."</title>
			<link>http://forums.leaflabs.com/topic.php?id=722#post-4233</link>
			<pubDate>Fri, 08 Apr 2011 00:12:07 +0000</pubDate>
			<dc:creator>Silntknight</dc:creator>
			<guid isPermaLink="false">4233@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I understand how to get the interrupt (nearly the same as with the Maple), but what I was wondering about is mostly how to get the most accurate timing possible over a certain time span. I will do some more reading about the Arduino's timers.&#60;/p&#62;
&#60;p&#62;For the PWM, I should have been more specific. I intend to use the prescaler to generate a square wave at a particular frequency. The actual pulse-width is irrelevant as the Maple only cares about the rising change.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Using another microcontroller (Arduino?) as an oscilloscope."</title>
			<link>http://forums.leaflabs.com/topic.php?id=722#post-4226</link>
			<pubDate>Thu, 07 Apr 2011 18:50:29 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">4226@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Okay. The Arduino only has one timed input, so you could use Timer/Counter2 for one, and a pin change interrupt for the other, or use pin change interrupts for both.&#60;/p&#62;
&#60;p&#62;There are some Arduino library calls to attach your code to the two pin-change interrupts.&#60;br /&#62;
&#60;a href=&#34;http://arduino.cc/en/Reference/AttachInterrupt&#34; rel=&#34;nofollow&#34;&#62;http://arduino.cc/en/Reference/AttachInterrupt&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;All the Arduino timer/counters are set up for 8-bit resolution by default, with a period of 1msec.&#60;br /&#62;
Consider setting up the 16-bit Timer/Counter1 for maximum resolution. I think it can be set to period of a few 10's of msec, which would let you reset it each 17msec cycle, and still get reasonable resolution for each event.&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62; I need to use one of the Arduino's timers for a PWM to provide the frequency...&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;I think we've had this discussion before, and I failed to explain the difference, let me try again.&#60;/p&#62;
&#60;p&#62;I think what might be meant is use the Arduino's timer to generate a square wave?&#60;/p&#62;
&#60;p&#62;PWM is all about controlling the mark:space ratio of the signal (that's what Pulse-width Modulation means) and not its frequency.&#60;/p&#62;
&#60;p&#62;I imagine it is more important to have good control over the frequency of the signal, rather than the mark space ratio.&#60;br /&#62;
If I remember correctly, there are some extra ATmega timer/counter modes which would help.&#60;br /&#62;
(Of course, if you want a fixed frequency, and a variable mark:space ratio, that is exactly PWM)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Silntknight on "Using another microcontroller (Arduino?) as an oscilloscope."</title>
			<link>http://forums.leaflabs.com/topic.php?id=722#post-4214</link>
			<pubDate>Thu, 07 Apr 2011 14:14:33 +0000</pubDate>
			<dc:creator>Silntknight</dc:creator>
			<guid isPermaLink="false">4214@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I am trying to capture digital events and the time between events.&#60;/p&#62;
&#60;p&#62;The program I am running on the Maple will output 4 digital events of varying lengths based on a frequency it receives. I need to use one of the Arduino's timers for a PWM to provide the frequency but I want to use the Arduino's two external interrupts to log which event is occurring (event 1 or 2) and at what time it goes high or low.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Using another microcontroller (Arduino?) as an oscilloscope."</title>
			<link>http://forums.leaflabs.com/topic.php?id=722#post-4196</link>
			<pubDate>Thu, 07 Apr 2011 05:00:14 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">4196@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;What is it you are trying to capture?&#60;br /&#62;
Is it an analogue voltage, or a digital event, or the time between events?&#60;/p&#62;
&#60;p&#62;If it is time based, I'd use an Arduino timer, and program it.&#60;/p&#62;
&#60;p&#62;I like the 16 bit timer, which can be set for relatively accurate timing, the base frequency can be adjusted (a bit) to maximise its precision.&#60;br /&#62;
Timer2 is an 8-bit timer, but can be used to directly measure the time between digital events. &#60;/p&#62;
&#60;p&#62;If you can explain what it is you're aiming to get, we may be able to give some more advice.&#60;/p&#62;
&#60;p&#62;If you can connect the Arduino to a PC, and there isn't too much data, it could print the data on the serial port as it is captured, and use timers and interrupts to keep the sampling consistent.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Silntknight on "Using another microcontroller (Arduino?) as an oscilloscope."</title>
			<link>http://forums.leaflabs.com/topic.php?id=722#post-4194</link>
			<pubDate>Wed, 06 Apr 2011 23:08:48 +0000</pubDate>
			<dc:creator>Silntknight</dc:creator>
			<guid isPermaLink="false">4194@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I have a Maple but rare access to an oscilloscope. In addition, I have a program that runs every 17 ms or so, which makes it hard for me to just light up an LED to check the output state and timing. I asked a friend to borrow his Arduino, and now I'm wondering if it might work to turn the Arduino into a raw data collector for an oscilloscope. Preferably I would use a Maple because I will be using interrupts to log events, but the Arduino will have to suffice. I know that the frequency of the events is constant (and repeatable unless the code happens to get buggy after a few billion cycles), so my major issue is collecting data for a specific time period. I was thinking something like:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;long t_0 = millis();
while(millis &#38;lt; (t_0 + 1000)) {
 ;
}
detachInterrupt();&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I'm not entirely sure how well that would work, but that would be the basis for timing (very close to) 1 second. I would simply use a counter to log events.&#60;/p&#62;
&#60;p&#62;In the more complicated form, I would use an array to both log events and &#34;time stamp&#34; them. I know there was another thread (&#60;a href=&#34;http://forums.leaflabs.com/topic.php?id=717&#34; rel=&#34;nofollow&#34;&#62;http://forums.leaflabs.com/topic.php?id=717&#60;/a&#62;) that dealt with this issue, but advice on how to time stamp for longer intervals (like 1 second) without losing accuracy would be appreciated. Let me know what you all think!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
