Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Question comparing Netduino vs Arduino


  • Please log in to reply
11 replies to this topic

#1 vader7071

vader7071

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts
  • LocationDothan, AL

Posted 22 August 2014 - 02:57 PM

Got a question that hopefully the awesome guru's here can help me with.

I'll admit, I went and looked at the darkside of the "duinos" and downloaded the Arduino programming software.

To try and get a feel for it, I just tried recreating a program that I have made recently using a MAX7219 (yeah I know, but for some reason, all my projects are so much easier using that chip).

In playing around, I got noticing something. To make my random display generator on my Netduino, the code is fairly long and intensive. I have found 2 or 3 different ways to get the desired output, but each method comes with a cost. One method I can only have one type output, no matter how many chips, they all do the same thing. Another method, I get my various outputs, but my speed is SEVERELY compromised.

When I did it on the Arduino platform, my code is SO much shorter. All I have to do is say how many chips, create a random number, write the random number in a for loop, and done. I get the end result.

My question is why? What is the difference between the two? In Netduino world, I had to include a second (or sometimes 3rd) .cs file referred to as a driver. In the Arduino world, I had to load a library. Is that the same concept? Is there a way I can use the Arduino library in my Netduino project to function as I want? I noticed the Arduino library is in a .cpp file and an .h file. I am assuming this is C++ and a header file. Can this be just re-saved into a C# (.cs) file and work?

Just trying to learn all I can and try and make my life easier. Thanks in advance for your help and knowledge.

#2 beastyboy

beastyboy

    Advanced Member

  • Members
  • PipPipPip
  • 194 posts
  • LocationNetherlands

Posted 22 August 2014 - 04:05 PM

Hi,

Arduino and Netduino's are two different worlds software wise.

The Arduino libraries contain a lot of functionality that is not ever written for the netduino.

What you could do is look into the original source code for the functionality you need and port that piece of software to the Netduino.

Arduino is written in C and not in C# they are very different beasts.

There are some C/C++ coders here in the community that probably could help you reproducing the C/c++ code in C#.

Cheers
Olaf

Van SchOten Ict Diensten en Services
http://www.voids.nl


#3 ShVerni

ShVerni

    Advanced Member

  • Members
  • PipPipPip
  • 138 posts
  • LocationNew York, New York

Posted 22 August 2014 - 06:06 PM

I'm certainly no expert, but I have done a bit of work on both Arduino and Netduino, even trying to get them to work together. Here is a brief overview of my impressions of the systems, their strengths and weaknesses.

 

I've, personally, found that Arduinos are much easier to use for specific tasks. That is to say, if I want to have a microcontroller do one, maybe two, things (act as a doorbell, generate random text sentences when a button is pressed, create an optotheremin etc...) Arduinos are often much simpler and faster to get up and running, or at least no more difficult. This is largely do to the fact that, because of their age and popularity, there are vast quantities of libraries (yes, those are very similar to including additional .cs files) and other code examples out there on the Internet where very talented people have already worked out most of the details.

 

Since Arduinos don't have the overhead or quirks of the .NETMF, they can more easily do things that require fast, precise timing (see the WS2812 LEDs), and they seem to require less boilerplate code to setup since there's no framework to deal with (although that's really a matter of where you look in the code, since .NETMF also provides some great shortcuts).

 

Where I find the Netduino really shines is for more complicated tasks. Since an Arduino runs everything in a single main loop, to have multiple inputs (say, serial inputs, buttons presses, and analogue sensors) requires creating a state machine or other complex system, and Arduinos are generally limited to only two hardware interrupt ports. Thanks to Netduino's interrupts and multithreading, it's much easier to keep track of all the inputs and outputs for complicated projects.

 

For instance, while I likely could have used an Arduino for setting up my garden project, I think the Netduino made organizing all the lights, and pumps, and Bluetooth commands, and SD card read/writes, and moisture sensors so much easier. I would have gotten lost trying to set up all the conditional options with an Arduino. Now, those more skilled in working with Arduino than myself would likely be able to pull it off without too much trouble, but I still prefer the modular organization, and other nifty features, offered by the .NETMF and VisualStudio.

 

I've always liked the idea of playing to the strengths of each system by using a Netduino as a command and control center using serial to send instructions to Arduinos which are set up to do specific things, but that's just me. In short, as an amateur in this field, my experience has been that Arduinos are super easy to get up and running for simple tasks, but for more complicated projects, or things without existing Arduino libraries, I find the Netduino easier to work with.

 

That's just my long-winded opinion, but I hope it helps in some way.



#4 vader7071

vader7071

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts
  • LocationDothan, AL

Posted 22 August 2014 - 10:01 PM

Thanks for the replies.  And thanks for the description of the difference.  With some of the projects I have in mind, I will need the extra "umph" of the Netduino to pull it off.

 

I did find a thread about converting an Arduino library to a Netduino class.

 

http://forums.netdui...ino/#entry59862

 

So far not doing too bad converting it over.  Just got a couple more errors to fix and I am good to try it out.



#5 knuckles

knuckles

    Member

  • Members
  • PipPip
  • 10 posts

Posted 13 September 2014 - 01:50 PM

lousy toolchain on the netduino ,looking at the uecide



#6 Spiked

Spiked

    Advanced Member

  • Members
  • PipPipPip
  • 129 posts

Posted 13 September 2014 - 05:05 PM

Lousy toolchain? What is your criteria? That it must look archaic? That must be it if you are thinking uecide is in the ballpark.

 

Sure there are a lot more imbedded level code samples/examples for the Arduino. It has a large community with that as the focus. The Netduino community is rather small and young so far. But there is no comparison between the languages Wiring (C++ like) and C# or even VB.Net. .Net is decades ahead of Wiring language wise.

 

An then are NO high level functions provided by an Arduino.  The code you write is all that is running, tiny, simple and mostly fast.

 

.Net provides much greater functionality. No need to use pointers (yes, they are a bad thing), Actual remote debugging, (not printf to a serial port), collections similar to STL (which I have never seen on an Arduino), actual documentation (up to date and not some stale automatically generated help files) .... and many more I can't think of at the moment.  These are provided at a cost of speed, but they are usually are written in a manner that is far more efficient than anything you are going to write that does the same thing.

 

And now let's talk IDE.  The absolute worst case is Visual Studio may not be the best anymore, only tied as the best (Eclipse). And in a .Net environment, you can not even say that, since Eclipse does not do .Net debugging. Refactoring built in (change a variable name one place, the IDE takes care of it everywhere, automatically)  Find definitions and references to variables, not some limited text search and replace, that does not consider the language syntax. Project management without the need to manually edit and manipulate build/make files, although that is an option if desired. And my favorite, it does not look like it was written by dinosaurs in COBOL.  Having a professionally thought out IDE is especially important when you spend 8+ hours a day writing code. Visual Studio has been maturing for 25+ years, from a company that knows a little about how people use computers (like it or not, still 87% market share, down from 95%). 



#7 gfcwfzkm

gfcwfzkm

    Advanced Member

  • Members
  • PipPipPip
  • 52 posts
  • LocationBrig-Glis, Switzerland

Posted 03 October 2014 - 01:25 PM

Well i prefer my simple AVR (arduino) microcontrollers. I can simply do more stuff with then than a netduino (main reason: netduino is dead-slow in the microcontroller-world) and i love all the Interrupts on the AVR microcontrollers. Every PIN can generate an Interrupt, even if its configured as output-pin (Software-generated interrupt). All the timers, comparators, ADC, USART.... :o

 

IDE: Atmel Studio 6, based on Visual Studio :). You can use Atmel Studio 6 for Arduino Boards too (with all the Librarys).

 

Well, the question is, what do u wanna create/make?

 

I do a lot stuff with sensors, so Interrupts and Fast-Code is more important for me. Actualy, i only used the Ethernet-Port-Network stuff of my Netduino Plus. For the Rest it just hadn't the speed or the memory.



#8 Spiked

Spiked

    Advanced Member

  • Members
  • PipPipPip
  • 129 posts

Posted 03 October 2014 - 03:14 PM

You are confusing 'fast' with 'apparently fast because it does nothing for you'.  I agree sometimes appearance is important, but it's not the chip. The Netduino chip runs circles around anything on an Arduino; at very least its 32 bit vs 8.

 

I've said it before and I'll reiterate; the Netduino targets developers who are familiar with the .Net environment, or who would prefer to learn with a .Net environment and there are plenty of reasons to. .Net/C# being a modern managed object oriented platform is top on the list.

 

Indeed there are times when raw speed is more important, and times when it is not, and a lot of time in the middle where it is just a matter of knowing how to achieve apparent speed. Sometimes figuring out how to make the Netduino look fast is the enjoyable challenge we are looking for.

I have a particular example; I wanted something that could read quadrature encoders from 2 motors, control both of their speeds and incorporate 2 ultrasonic sensors to prevent running into things. It connects to the main computer and receives 'commands' via ethernet. The commands I send it are high level;  'move 14.3 meters' 'turn 43.2 degrees right' 'move 17 meters in reverse' all the while telling me exactly where you are 15 times per second.  Can an Arduino do this? Probably, if I started now, in about 18 years ( I have no embedded development experience, no hardware experience, 25+ years Application software experience with C#). While I have cussed it several times, I expect I can accomplish it on the Netduino considerably faster (Actually it is about 90% complete, in a couple of months). Believe me, if I could buy an off the shelf device that did this (like a LEGO could 10 years ago) I'd be happier. But I can't, so this is my fastest way to something I want to move my Robot, without hacking hardware and learning a new profession in depth.

 

I do not follow your comment about interrupts. My application uses 6, the Arduino has 2. I would have to stack 3 Arduinos, plus probably a 4th with an ethernet shield, to get the same capabilities. These are real interrupts, they can not be missed 'whenever' like software versions do. Want a good example? Try using a software serial port while you are doing other things with your Arduino.

 

http://www.spiked3.com

 

Untitled-13.png

 



#9 gfcwfzkm

gfcwfzkm

    Advanced Member

  • Members
  • PipPipPip
  • 52 posts
  • LocationBrig-Glis, Switzerland

Posted 09 October 2014 - 08:11 AM

True, for .NET Developers is a .NET-Board much better.

 

But since im studing electronic engineer ('Elektroniker' in German, not sure if GoogleTranslate was correct) So i got "converted" to C and 8Bit-Microcontrollers (at the moment, we are learning ARM and FPGA). And since i have to watch to my pocket money (in job and private). I cannot use for every little project an Netduino Plus 2. The Netduino Plus 2 Costs 79.90 CHF (~85$) on my local distributor (play-zone.ch).

An AVR-uC starts at 1.64 CHF (1.72$). I hope they add an tutorial/options to custom-Burn the Firmware on an blank STM32F4 Microcontroller to reduce cost's and size.

 

And the other reason was the "bad" support for VB-Developers. I used VB always for simple Windows Programs. But i only find C#-Developers, C#-Books or C#-Tutorials... :(

 

The 2 Interrupts, INT0 and INT1 can be triggered by a falling or rising edge or a low level. But every PIN can generate an interrupt when they get toggled. The difference is, that these 2 interrupts are "High-Level Interrupts". (Check out any ATMEGA datasheet. In the "Pin Configurations", all these PCINTXX are Interrupts :D ).

 

What i also miss are timers :( . Timers are a big reason why i dont use the NETMF anymore because you can do much stuff with them.

 

Oh, and about the Software Serial Port: No problem since the AVR Microcontroller can toggle their PINs faster than the Netduino Plus 2 ( :)  yes, i can use WS812-LEDs at only 8MHz Speed). So with an AVR uC u would maybe reach higher speed with the Software Serial Port than with an Netduino. Or you use the (up to two) Hardware Serial Ports with a Baud rate of up to 2.5Mbps.

 

So i hope they include more options to the NETMF Framework to get better Access to some Low-Level Registers ,Functions and maybe an option for an "WatchDog". Timer for example (the Controller on the Netduino Plus 2 has 17 Timers.

And a new small Netduino Mini (maybe an Netduino Nano? :o ). So it would be small and cheap :)

 

mfg

 

gfc



#10 mcfd

mcfd

    Member

  • Members
  • PipPip
  • 11 posts

Posted 15 January 2015 - 05:55 AM

Lousy toolchain? What is your criteria? That it must look archaic? That must be it if you are thinking uecide is in the ballpark.

 

Sure there are a lot more imbedded level code samples/examples for the Arduino. It has a large community with that as the focus. The Netduino community is rather small and young so far. But there is no comparison between the languages Wiring (C++ like) and C# or even VB.Net. .Net is decades ahead of Wiring language wise.

 

An then are NO high level functions provided by an Arduino.  The code you write is all that is running, tiny, simple and mostly fast.

 

.Net provides much greater functionality. No need to use pointers (yes, they are a bad thing), Actual remote debugging, (not printf to a serial port), collections similar to STL (which I have never seen on an Arduino), actual documentation (up to date and not some stale automatically generated help files) .... and many more I can't think of at the moment.  These are provided at a cost of speed, but they are usually are written in a manner that is far more efficient than anything you are going to write that does the same thing.

 

And now let's talk IDE.  The absolute worst case is Visual Studio may not be the best anymore, only tied as the best (Eclipse). And in a .Net environment, you can not even say that, since Eclipse does not do .Net debugging. Refactoring built in (change a variable name one place, the IDE takes care of it everywhere, automatically)  Find definitions and references to variables, not some limited text search and replace, that does not consider the language syntax. Project management without the need to manually edit and manipulate build/make files, although that is an option if desired. And my favorite, it does not look like it was written by dinosaurs in COBOL.  Having a professionally thought out IDE is especially important when you spend 8+ hours a day writing code. Visual Studio has been maturing for 25+ years, from a company that knows a little about how people use computers (like it or not, still 87% market share, down from 95%). 

 

Programming language is only part of the story. Platform stability/robustness may be more important imho. I have experienced a few nasty bugs in Netduino Plus 2 that have not yet been fixed (even in 4.3) ! I am seriously considering abandoning Netduino because of those unsolved bugs!

 

Bug list:



#11 Spiked

Spiked

    Advanced Member

  • Members
  • PipPipPip
  • 129 posts

Posted 27 February 2015 - 02:32 AM

At Microsoft's current pace it shouldn't take any longer than another 25 years or so to resolve them. I too switched to Arduino a while back, after real life experience. It wasn't the IDE though. I still use Visual Studio.



#12 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 28 February 2015 - 05:54 AM

Hi mcfd,
 

Bug list:
* Ethernet hangs and need to be power cycled:


Just FYI... That should be fixed with the upcoming 4.3.2 firmware (which will use Netduino.IP). Microsoft is working on several NETMF bugfixes; for that issue we went ahead and used a very large hammer :)

By the way, Secret Labs and many others build commercial MCU-based gear using NETMF, prototyped using Netduino. There are pros and cons to interpreted vs. native code, sandboxes vs. direct register access, etc. Every tool has its place--but I am consistently impressed with the sheer number of applications where NETMF shines.

In any case, thank you for being part of the Netduino community,

Chris




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.