<?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: Processing of Maple data using a DLL</title>
		<link>http://forums.leaflabs.com/topic.php?id=210</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:22: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=210" rel="self" type="application/rss+xml" />

		<item>
			<title>gbulmer on "Processing of Maple data using a DLL"</title>
			<link>http://forums.leaflabs.com/topic.php?id=210#post-1513</link>
			<pubDate>Sat, 02 Oct 2010 12:46:58 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">1513@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;The STM32F103 needs to have the processor clock slowed to 56MHz, so that the ADC clock is 14MHz. So better than you had expected !-)&#60;/p&#62;
&#60;p&#62;Yes, I'd guess around 1Mbytes/second from Maple's on-board USB, until I have good tests.&#60;br /&#62;
That's approximately 100x faster than an Arduino, so I am still pretty happy :-)&#60;/p&#62;
&#60;p&#62;The fastest STM32F103 serials are 4.5Mbit/second, so even slower than USB. I'd assume the STM32F USARTs are reliable enough that the host PC might be a problem.&#60;/p&#62;
&#60;p&#62;I have only looked at a couple of Arduino Ethernet shields, and they were 10Mbit/second, but didn't get that fast as the SPI maxed out before then.  The SPI on the Maple will go much faster, so they may still be worth investigating.&#60;/p&#62;
&#60;p&#62;Other possible higher speed interfaces include the FTDI FT2232 module that Josheeg is using.&#60;br /&#62;
FTDI FT2232H datasheet claims&#60;br /&#62;
&#60;a href=&#34;http://ftdichip.com/Products/ICs/FT2232H.htm&#34;&#62;USB to parallel FIFO transfer data rate up to 8 Mbyte/Sec.&#60;br /&#62;
Single channel synchronous FIFO mode for transfers &#38;gt; 25 Mbytes/Sec.&#60;br /&#62;
USB Bulk data transfer mode (512 byte packets in High Speed mode). &#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Yes, once 0.0.7 is out, I'll have a better understanding if I want to hack on it or use it as it comes.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>StephenFromNYC on "Processing of Maple data using a DLL"</title>
			<link>http://forums.leaflabs.com/topic.php?id=210#post-1510</link>
			<pubDate>Sat, 02 Oct 2010 09:18:05 +0000</pubDate>
			<dc:creator>StephenFromNYC</dc:creator>
			<guid isPermaLink="false">1510@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;Yes, for purposes of increased ADC sampling speed (1 megasamples/sec) I think the lower processor speed is a reasonable tradeoff.  It has been a few weeks since I last looked at the specifications sheet, but I think the STM32F103RB has to be slowed from 72 MHz to 48 Mhz for this to work.&#60;/p&#62;
&#60;p&#62;I think I understand why DMA is useful to fast ADC (data movement around the microcontroller chip without using clock cycles), but I do not know how to get data from the Maple to the system at a high rate.  What do people use?&#60;/p&#62;
&#60;p&#62;Honestly, when I first read that the Maple board supports USB 2.0 I assumed this meant the very useful 480 mbps rate. However, this is the &#34;high speed&#34; rate.  The &#34;full speed&#34; USB 2.0 rate is only 12 megaBITs per second (roughly 1 megaBYTEs per second).&#60;/p&#62;
&#60;p&#62;On the Maple how fast can SerialN be pushed?  115200 baud is faster than 9600, but not fast enough if data is being collected at 1 megasamples/sec.  Is high speed SerialN reliable at the highest speeds?  Is high speed SerialN reliable for continuous periods of time or only in short spurts (think marathon running vs 100 meter sprinting).&#60;/p&#62;
&#60;p&#62;Or do we need to use ethernet?  On the Maple is the maximum speed 100 megabits/sec or 1000 megabits/sec?  Which Arduino ethernet shields are most reliable for the highest rates of data transfer?&#60;/p&#62;
&#60;p&#62;I think I will try pushing the Maple to 1 megasamples/sec after 0.0.7 comes out.  It will be easier to benchmark the ADC using micros().&#60;/p&#62;
&#60;p&#62;Hopefully where we go with our ADC projects will be more clear after 0.0.7 is released.&#60;/p&#62;
&#60;p&#62;Thanks for your ideas and help!  I am still a work in progress!&#60;/p&#62;
&#60;p&#62;Stephen from NYC
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Processing of Maple data using a DLL"</title>
			<link>http://forums.leaflabs.com/topic.php?id=210#post-1506</link>
			<pubDate>Fri, 01 Oct 2010 19:47:09 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">1506@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Stephen - I did understand that your were writing about using DLLs on the host, and not the Maple :-)&#60;/p&#62;
&#60;p&#62;Yes, other OS's have dynamically linked libraries, some *NIX call them &#34;shared libraries&#34;.&#60;/p&#62;
&#60;p&#62;Several people believe shared libraries/DLLs are a bad idea.&#60;br /&#62;
For example, &#60;a href=&#34;http://harmful.cat-v.org/software/dynamic-linking/&#34;&#62;Rob Pike&#60;/a&#62; of UNIX, Plan 9, Squeak, and now Go lang. Go lang has no dynamic library support, partly because Go lang is designed for servers, and DLL's can be a security nightmare.&#60;/p&#62;
&#60;p&#62;My favourite quote is &#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;When Sun reported on their first implementation of shared libraries, the paper they presented (I think it was at Usenix) concluded that shared libraries made things bigger and slower, that they were a net loss, and in fact that they didn't save much disk space either.  The test case was Xlib, the benefit negative. But the customer expects us to do them so we'll ship it.
&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;Anyway Java has pretty good support for accessing the underlying system, so I'll wait until you have a concrete example before making anymore suggestions.&#60;/p&#62;
&#60;p&#62;I am interested in fast ADC sampling, but I'm waiting to see what 0.0.7 brings.&#60;/p&#62;
&#60;p&#62;For a regular signal, or one with a good external trigger, DMA is the way to sample as fast as possible.&#60;br /&#62;
Maybe even drop the processor speed to get the ADCs to run at 1Msample/second !-)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>StephenFromNYC on "Processing of Maple data using a DLL"</title>
			<link>http://forums.leaflabs.com/topic.php?id=210#post-1505</link>
			<pubDate>Fri, 01 Oct 2010 18:49:50 +0000</pubDate>
			<dc:creator>StephenFromNYC</dc:creator>
			<guid isPermaLink="false">1505@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;In my first post I said:&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;
Does anyone have experience with using DLL to process data generated with a Maple?&#60;/p&#62;
&#60;p&#62;This might be accomplished using Processing or another app as a &#34;bridge&#34; (assuming the DLL is running on the system processor, and not the microcontroller).
&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;To be more clear what I should have said is that I was curious about possibly using a DLL running on the system (not on the Maple) to process data (on the system) AFTER the data is sent from the Maple to the system.  All the Maple is doing is sending some information to the system.  It was more of a &#34;test-of-concept&#34; question prompted by recent discussions of porting Arduino/MATLAB and Arduino/LabVIEW code to work with the Maple.  Often not a trivial problem.&#60;/p&#62;
&#60;p&#62;A) The &#34;bridge&#34; app (which transfers the data from the Maple to the DLL) could be written in C/C++, java, or another language.  I just mentioned Processing as a possibility because it seems to be a popular language for manipulating data sent from the Arduino via the Serial port.  Yes, I have seen projects which use Java to call DLLs.&#60;/p&#62;
&#60;p&#62;B) These day when I program I use Windows (because I have LabVIEW on my Windows system).  Most DLLs which I know are for Windows.  Do other OS use DLLs?  Honestly, I never liked the concept.&#60;/p&#62;
&#60;p&#62;C) I am definitely now an elegant programmer (which is obvious from my use of braces when I code).  I taught myself C a long time ago, but I never did any system programming.  I once used some low level bit-manipulations for a graphics programming project.&#60;/p&#62;
&#60;p&#62;A few years ago I was dual-booting Windows and Fedora.  In order to get a wireless card to work I had to compile some code on my system.  I think I used a Windows OS DLL to get wireless working on Fedora!&#60;/p&#62;
&#60;p&#62;Today, if I do any non-trivial programming my choice is java.  This makes it easier for me to use the code on computers running a different OS.&#60;/p&#62;
&#60;p&#62;I like using XEmacs as my editor, but I will switch to Vim for some substitions.&#60;/p&#62;
&#60;p&#62;I am curious about learning low-level programming using the Maple, because I want to modify the interrupts to improve ADC speeds.&#60;/p&#62;
&#60;p&#62;Hope this summary helps.&#60;/p&#62;
&#60;p&#62;Stephen from NYC
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Processing of Maple data using a DLL"</title>
			<link>http://forums.leaflabs.com/topic.php?id=210#post-1496</link>
			<pubDate>Fri, 01 Oct 2010 14:28:57 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">1496@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Stephen - Just to get a bit better understanding, I'd like to ask a few more questions. &#60;/p&#62;
&#60;p&#62;Are you hoping to use handy dynamic link libraries:&#60;br /&#62;
a. From Processing, or are there other acceptable languages?&#60;br /&#62;
Processing is Java underneath, so Java mechanisms like JNI might be enough. But there are other technologies for creating &#34;foreign&#34; interfaces like SWIG (&#60;a href=&#34;http://www.swig.org/&#34; rel=&#34;nofollow&#34;&#62;http://www.swig.org/&#60;/a&#62;) which may be relevant.&#60;/p&#62;
&#60;p&#62;b. On a single platform, or are you likely to need portability across Linux, Mac and Windows?&#60;br /&#62;
Clearly the DLL needs to be available on the platforms you want to use, but some of the mechanisms on each platform may be sufficiently different that it is worth looking at a technology, maybe like SWIG to get some cross-platform support. I realise you said Windows or Mac, with Linux a distant 3rd, but is their a DLL you have in mind which exists on more than one? (The DLL will be compiled specifically for each platform, and won't itself be portable, but it may contain the same functions).&#60;/p&#62;
&#60;p&#62;Are you likely to have access to the source code?&#60;br /&#62;
It may be much harder to use the DLL in a robust way, from some languages, otherwise.&#60;/p&#62;
&#60;p&#62;Can you write C?&#60;br /&#62;
A lot of ways at getting at low-level stuff use C or C++. &#60;/p&#62;
&#60;p&#62;&#60;em&#62;(Health Warning - I am not a SWIG user, though I did consider using it some years ago)&#60;/em&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>StephenFromNYC on "Processing of Maple data using a DLL"</title>
			<link>http://forums.leaflabs.com/topic.php?id=210#post-1488</link>
			<pubDate>Thu, 30 Sep 2010 21:41:40 +0000</pubDate>
			<dc:creator>StephenFromNYC</dc:creator>
			<guid isPermaLink="false">1488@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;Yes, it is completely clear that the external code which operates on the captured maple data does not need to be a DLL.  Yes, any program which can read a serial port can then manipulate the captured maple data.&#60;/p&#62;
&#60;p&#62;However, if a DLL already exists which does everything a user needs (and perhaps some things better than the user can code) why not use the DLL?&#60;/p&#62;
&#60;p&#62;Another way to say this is why reinvent the wheel if the code (in the format of a DLL) has already been written, has been tested, and is available.&#60;/p&#62;
&#60;p&#62;Thanks!&#60;/p&#62;
&#60;p&#62;Stephen from NYC
&#60;/p&#62;</description>
		</item>
		<item>
			<title>perry on "Processing of Maple data using a DLL"</title>
			<link>http://forums.leaflabs.com/topic.php?id=210#post-1484</link>
			<pubDate>Thu, 30 Sep 2010 18:16:03 +0000</pubDate>
			<dc:creator>perry</dc:creator>
			<guid isPermaLink="false">1484@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;hey stephen,&#60;/p&#62;
&#60;p&#62;I think you're misunderstanding the term DLL. A dynamically linked library is just a piece of code that can be shared with other programs running on a system. This is a useful idea when many programs need to share the same bit of code (eg. a drawing library).&#60;/p&#62;
&#60;p&#62;For the use case that you listed, the external bit of code that operates on the captured maple data doesn't need to be a dll at all. You can read the data from the maple with any program that can read a serial port, and operate on that data straight in that program. Alternatively, you can use other forms of inter-process communication (IPC) such as sockets (for communication over the internet), or shared memory. Both of these forms are likely to be fast enough to handle your data from the maple.&#60;/p&#62;
&#60;p&#62;i hope this clears things up
&#60;/p&#62;</description>
		</item>
		<item>
			<title>josheeg on "Processing of Maple data using a DLL"</title>
			<link>http://forums.leaflabs.com/topic.php?id=210#post-1483</link>
			<pubDate>Thu, 30 Sep 2010 17:50:57 +0000</pubDate>
			<dc:creator>josheeg</dc:creator>
			<guid isPermaLink="false">1483@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Well Xilinx as far as I know is the only place with linux closed source software for their FPGA's and their software you can make schematics of digital logic or code digital logic if you needed something that is like a lot of that.&#60;/p&#62;
&#60;p&#62;It can be modules like a adder is put into a module and used so it is expandable like that.&#60;/p&#62;
&#60;p&#62;That is a good way to share thowse on something like google sites file cabinet with versioning.&#60;/p&#62;
&#60;p&#62;Also schematics and digital symbols are easier than the fpga code ...&#60;br /&#62;
I switched from using a fpga to a maple and ft2232h for high speed usb to pc logging. the maple controls the transfer but the data goes streight to the ft2232h
&#60;/p&#62;</description>
		</item>
		<item>
			<title>StephenFromNYC on "Processing of Maple data using a DLL"</title>
			<link>http://forums.leaflabs.com/topic.php?id=210#post-1482</link>
			<pubDate>Thu, 30 Sep 2010 17:05:42 +0000</pubDate>
			<dc:creator>StephenFromNYC</dc:creator>
			<guid isPermaLink="false">1482@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Thursday September 30, 2010&#60;/p&#62;
&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;Let me try to flesh out my idea some more.  As I said in my first post I do not have an immediate need.  I am just looking for more ways to benchmark and debug the Maple software.&#60;/p&#62;
&#60;p&#62;Let me clear about what I am NOT proposing.  I was NOT hoping the DLL could run on the Maple (too complicated and not enough memory).  It is not clear how a DLL written for an X86 processor could run easily on a RISC processor such as the STM32.  I was NOT hoping to reprogram, update, or patch a sketch running on the Maple (but that would be an interesting trick if it could be done).&#60;/p&#62;
&#60;p&#62;When I named the initial post &#34;Processing of Maple data using a DLL&#34; I was focusing on the potential ability of the Maple to acquire DATA (via ADC) faster (ie. more samples/sec) and at a greater resolution (ie. 12-bit vs 10-bit) than the Arduino.&#60;/p&#62;
&#60;p&#62;So I was imagining this sequence of events:&#60;/p&#62;
&#60;p&#62;1) the Maple acquires data by reading analog pins (at a high rate &#38;amp; 12-bit resolution)&#60;br /&#62;
2) the Maple sends the analog data to the system (via some method).  I will be honest and say I still do not fully appreciate the full abilities/roles and limitations of DMA, I2C, SPI, and the serial communications options available to the Maple/Arduino.  The analog data might be stored temporarily in the Maple SRAM or FLASH if the data can be more sent more efficiently (eg faster) in large bundles to the system (instead of sending each individual analog read one at a time; which is what I am doing now with my LabVIEW/Arduino code).&#60;br /&#62;
3) a separate program running on the system (eg. Processing) simply reads the data sent from the Maple and relays the data to a DLL (eg. a graphing program).  This program might reformat the data a little, but not much is done.&#60;br /&#62;
4) the DLL running on the system processes or interprets the data (eg. graphing the data and saving the interpreted results in a file)&#60;/p&#62;
&#60;p&#62;So the Maple is just acquiring the data and sending it somehow to the system.&#60;/p&#62;
&#60;p&#62;Assuming this can be done already with the slower Arduino, the &#34;added value&#34; is knowing if the program running on the system (list #3) can read the data at the faster rate of the Maple and if the DLL (list #4) can also keep up.&#60;/p&#62;
&#60;p&#62;Of course, in the ideal world the original code for the DLL would be available and could be easily modified to interpret the increased 12-bit range (0-4095) of data values.  Perhaps the person who wrote the DLL thought ahead and created a flexible method for informing the DLL of the resolution of the incoming data (eg. 10-bit vs 12-bit).&#60;/p&#62;
&#60;p&#62;Where does an FPGA enter this conversation?  How is an FPGA used?  I know one will be on the Oak, but I have never used an FPGA before.&#60;/p&#62;
&#60;p&#62;I hope this makes more sense.&#60;/p&#62;
&#60;p&#62;Thanks!&#60;/p&#62;
&#60;p&#62;Stephen from NYC
&#60;/p&#62;</description>
		</item>
		<item>
			<title>perry on "Processing of Maple data using a DLL"</title>
			<link>http://forums.leaflabs.com/topic.php?id=210#post-1480</link>
			<pubDate>Thu, 30 Sep 2010 15:47:18 +0000</pubDate>
			<dc:creator>perry</dc:creator>
			<guid isPermaLink="false">1480@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi stephen,&#60;/p&#62;
&#60;p&#62;I'm not really sure what you mean by using a DLL with Maple. DLLs are shared libraries which are loaded by programs at run-time, hence the &#34;dynamic&#34; moniker. See &#60;a href=&#34;http://en.wikipedia.org/wiki/Library_(computing)#Dynamic_linking&#34; rel=&#34;nofollow&#34;&#62;http://en.wikipedia.org/wiki/Library_(computing)#Dynamic_linking&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;It's not clear why you would want a dynamically loaded library on the maple. You'd have to have some way of dynamically loading the code over some communication interface, placing it in RAM or flash, and then run a bunch of dynamic loader code to parse the binaries, fix up relocations, and then jump to the code. &#60;/p&#62;
&#60;p&#62;It would help if you told us what you wanted this for. I could see this being useful if for some reason you wanted to update the code on a maple at runtime while it was still running and performing other functions, but otherwise I don't see much use for it.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>StephenFromNYC on "Processing of Maple data using a DLL"</title>
			<link>http://forums.leaflabs.com/topic.php?id=210#post-1479</link>
			<pubDate>Thu, 30 Sep 2010 15:28:20 +0000</pubDate>
			<dc:creator>StephenFromNYC</dc:creator>
			<guid isPermaLink="false">1479@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;Yes, by DLL I mean &#34;dynamic link library&#34;.&#60;/p&#62;
&#60;p&#62;I am glad to hear there are several methods for accessing DLL code from the Maple/Arduino.&#60;/p&#62;
&#60;p&#62;Accessing DLLs might be another &#34;stress test&#34; for the Maple.&#60;/p&#62;
&#60;p&#62;Primarily Windows, but possibly Mac OS.  A few years ago I was dual booting Windows/Linux and perhaps I should do it again.  Linux would be a far third.&#60;/p&#62;
&#60;p&#62;I am most familiar with DLLs on the windows platform.  Can DLLs created on Windows be used on other platforms?&#60;/p&#62;
&#60;p&#62;Thanks!  Looking forward to your answers.&#60;/p&#62;
&#60;p&#62;Stephen from NYC
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Processing of Maple data using a DLL"</title>
			<link>http://forums.leaflabs.com/topic.php?id=210#post-1471</link>
			<pubDate>Thu, 30 Sep 2010 13:38:49 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">1471@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Stephen - By DLL do you mean a &#34;Dynamic-link library&#34; or something else?&#60;/p&#62;
&#60;p&#62;(I probably can't answer your question for procssing. though I am curious, but I'm not sure if you mean 'Dynamic-link library', so I thought I should seek clarification).&#60;/p&#62;
&#60;p&#62;There are a bunch of technologies for getting at &#34;Dynamic-link libraries&#34;, which platform/OS do you need to use?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>StephenFromNYC on "Processing of Maple data using a DLL"</title>
			<link>http://forums.leaflabs.com/topic.php?id=210#post-1469</link>
			<pubDate>Thu, 30 Sep 2010 12:13:03 +0000</pubDate>
			<dc:creator>StephenFromNYC</dc:creator>
			<guid isPermaLink="false">1469@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Thursday September 30, 2010&#60;/p&#62;
&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;Does anyone have experience with using DLL to process data generated with a Maple?&#60;/p&#62;
&#60;p&#62;This might be accomplished using Processing or another app as a &#34;bridge&#34; (assuming the DLL is running on the system processor, and not the microcontroller).&#60;/p&#62;
&#60;p&#62;I am just curious, because DLLs were mentioned during the Open Hardware Summit last week (I believe you can still view the &#34;legal&#34; session moderated by David Mellis).  I do not have an immediate need for accessing DLLs, but I may have one soon.&#60;/p&#62;
&#60;p&#62;Thanks!&#60;/p&#62;
&#60;p&#62;Stephen from NYC
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
