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

Arduino and Netduino pros and cons


  • Please log in to reply
17 replies to this topic

#1 Frank

Frank

    Advanced Member

  • Members
  • PipPipPip
  • 62 posts
  • LocationNorth Waterboro Maine

Posted 03 October 2010 - 06:10 PM

I've used the Arduino, had some fun times. I was delighted when I saw I could use the breakpoints and Visual Studio Express with the Netduino. But it doesn't seem to be a matter of transitioning FROM the Arduino TO the Netduino. Don't they serve two different markets and two different application pools? Since they are both low end and relatively inexpensive, and certainly BOTH are great for learning electronics AND programming, what are the practical guidelines for each? Speed and memory are different. I see folks talking about using video, or making MP3 players: are these rational targets? I'm not trying to rain on the parade, but I don't think one replaces the other. Where do folks see them going in the near future?
Retired -stone sculptor -macro photographer- novice but avid Go player - Geek

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 03 October 2010 - 06:40 PM

Hi Frank, Both Arduino and Netduino are great introductory platforms (8-bit and 32-bit correspondingly). A few reasons why users might want to pick up a Netduino: 1. With Netduino, you can create _really_ sophisticated projects 2. Visual Studio integration, ability to debug your Netduino apps 3. C# (and soon, Visual Basic) -- easy and ability to reuse code in phone/XBox/desktop/web apps 4. Lots of FLASH and RAM (4x FLASH, 30x RAM) 5. "32-bits for an 8-bit price" 6. True open source TCP/IP networking, simple USB functionality 7. Less need to switch to native C/C++ code for 'advanced' applications 8. 800mA power regulators, 16-bit PWMs, really nice hardware 9. MonoDevelop support project in progress (Mac/Linux future experimental support) 10. Next-generation technology 11. Etc. etc. A few reasons why users might want to pick up an Arduino: 1. "Lots of blinky lights" and other applications which require native code speed 2. Large pool of users, large pool of projects to pick from, lots of kits 3. Lots of clones to pick from, in a variety of form factors 4. Mac and Linux support today 5. Learning Arduino programming is a bridge between "easy" 8 bit programming and true C/C++ embedded programming 6. Etc. etc. The gentlemen from Arduino LLC are really nice people and they have done a lot for the open source hardware movement...There's nothing wrong with picking up a Netduino and then helping support their efforts too by picking up an Arduino. Chris

#3 Mark H

Mark H

    Advanced Member

  • Members
  • PipPipPip
  • 70 posts
  • LocationPerth, Western Australia

Posted 04 October 2010 - 01:15 AM

If you need realtime processing, go arduino or just get the raw MCU and program it like a "real man" hehe. Other than that, use a netduino/netmf based device. You'll end up with more hair at the end of the day and your time to release will be much faster. That being said, every device has it's place.

#4 Frank

Frank

    Advanced Member

  • Members
  • PipPipPip
  • 62 posts
  • LocationNorth Waterboro Maine

Posted 04 October 2010 - 02:54 AM

just get the raw MCU and program it like a "real man" hehe.


Oh, that made me laugh ! I've done my duty, 8080, 6502, 6800, 6809, and it took me ages
to 'trust' 'C' code and libraries written by someone else. My Visicalc floppy is hanging on the
wall next to the battery powered paper tape rewinder, and right underneath the Windows 1.0
floppies.

If you need a sweet deal on a stockpile of Tandy Color Computer ICs I can help you there. That was
enough to make a 'real man' out of many people. LOL I keep looking for my ASM disks, and assembly
books, but I just can't seem to find them.

Thanks though for the reply. I'm pretty new to both the Arduino and the Netduino, but that was the
way I was looking at them also. Aduinos around the house and garage, feeding data back to the Netduino, and then
local storage, or net. After 8 years of retirement it's feeling good to beat a keyboard again, and I always
loved the smell of solder.

I am using original 7400 A series a lot. They're probably collector items now, eh ?
Retired -stone sculptor -macro photographer- novice but avid Go player - Geek

#5 hari

hari

    Advanced Member

  • Members
  • PipPipPip
  • 131 posts

Posted 04 October 2010 - 03:59 AM

If you need realtime processing, go arduino...

I'm curious if you or anyone else ever hit the real-time processing limitation of netmf.
I realize the interpreted netmf is slower than arduino's compiled C, but so far it seems fast enough?!
How often does garbage collection in realtime apps? Can it be avoided by carefully forcing garbage collection at convenient times?

It'd be an interesting challenge to attempt to create a real-time app in netmf. Any suggestions? Maybe it's a myth? Maybe Netduino can do everything Arduino can?

#6 Mark H

Mark H

    Advanced Member

  • Members
  • PipPipPip
  • 70 posts
  • LocationPerth, Western Australia

Posted 04 October 2010 - 04:44 AM

If you need nanosecond accuracy - eg: bitbang a protocol, netmf will not do it - raw processors of any sort will. Be it Atmega's, PIC/dsPIC, cyprus, ARM... whatever. Arduino is just an Atmel AVR remember - with some helper libraries. If you want to hold a pin on for exactly 22.45micro seconds, you can't do that on a managed system - you can on a raw micro. If you wanted to process a video stream and overlay text on it, such as AVROSD does - you couldn't do it in NetMF - it simply doesn't have the fine timings or reliability for timings that something which is done in assembly does. In assembly you can precisely count exactly how many cpu instructions will get executed, and based on the click speed and MIPS you know the processor is running at - know exactly how many nanoseconds that will take. On NetMF that isn't possible. Interrupts get raised 1-2ms late (1/1000th to 1/500th of a second late) - that is a *huge* amount of time. On top of the OSD example, how about you're using a bullet to break a light beam, so you can fire a flash or camera as the bullet hits an object. At several inches per milisecond your bullet could be long gone if you miss by 1ms. With a raw processor however you'd be having everything happening within nanoseconds...not even us... or ms... ns.. On NetMF however, you can do things that would only be a dream on an 8 bit micro in 1/100th the time it would take in something like C from scratch. NetMF offers a huge amount of flexibility and libraries and debugging support - at the cost of realtime processing.

#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 04 October 2010 - 05:37 AM

To add to what Mark said, you can write native C/C++ code that runs "behind the scenes" alongside .NET MF if you'd like. For instance, you can create timer-interrupt-driven code to handle real-time tasks...and manage the "control" side of things in C#. But then you're writing the native code in C/C++. The .NET MF team has looked at supporting real-time in a future release of .NET MF. No concrete plans that I know of, but it would be cool! Chris

#8 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 04 October 2010 - 06:40 AM

I'm curious if you or anyone else ever hit the real-time processing limitation of netmf.

It depends on how exactly you define 'real-time'. Usually, people by 'real-time' mean anything that is 'really fast' or has 'an immediate response'. But the key characteristic of 'real-time' [operating system] is consistency concerning the amount of time it takes to accept and complete an application's task (Wikipedia). This means that you always know how long it takes to meet a deadline (e.g. response to an event, such as interrupt) - in hard real-time this is deterministic, i.e. predictable. .NET Micro Framework is not hard real-time, because garbage collector delays (queued) interrupt handler execution by undetermined amount of time, although there is an upper limit (based on size of available RAM).

Can it be avoided by carefully forcing garbage collection at convenient times?

Probably yes, but IMHO better would be to code the program in such way it does not need garbage collection at the first place, e.g. by reusing objects, static instances etc.

If you need nanosecond accuracy - eg: bitbang a protocol, netmf will not do it...
If you want to hold a pin on for exactly 22.45micro seconds, you can't do that on a managed system

This is possible in .NET Micro Framework platform with a help of native code. I have been able to implement code with 1 µs accuracy (reproducible), and there is already BigBanger driver sample. Additionally, in certain cases a hardware feature can be 'abused', e.g. it is possible to generate signals with precise timing via SPI, USART, PWM, precisely measure input via Timer Capture/Compare unit etc. Netduino is limited by what is available through the pin headers and firmware code, the microprocessor itself has many such features.

On NetMF that isn't possible. Interrupts get raised 1-2ms late (1/1000th to 1/500th of a second late) - that is a *huge* amount of time.

Yes, this is indeed long time - but you can compensate for it with clever programming, it is possible for example to use interrupt timestamp (passed to the handler via its argument) like phil did in his RC6 Decoder.

#9 Fred

Fred

    Advanced Member

  • Members
  • PipPipPip
  • 302 posts
  • LocationUK

Posted 04 October 2010 - 09:11 AM

Personally, if I was doing anything that required really accurate timing I'd be tempted to do that bit entirely with hardware. Then use the Netduino for the more complicated but less time-critical stuff. E.g. a pin for exactly 22.45 microseconds - use a 555 timer. Triggering this pulse when your RFID tagged cat tries to crap on your vegetable patch - use the Netduino.

#10 greg

greg

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationChicago, IL

Posted 04 October 2010 - 01:30 PM

An interesting processor as well is the Propeller from Parallax. It's got a high level language called "SPIN" that you can use, and also assembly. Plus it's an 8 core processor. An interesting little chip for only $8. They also have a C compiler for it.

#11 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 04 October 2010 - 01:47 PM

E.g. a pin for exactly 22.45 microseconds - use a 555 timer. Triggering this pulse when your RFID tagged cat tries to crap on your vegetable patch - use the Netduino.


Fred, I think you hit it right on the money here. Most users will probably go this route--"logic and control" using their Netduino, interfacing with other chips that do specifically-designed jobs like precise timing.

And some advanced users will integrate some custom native code into their Netduino firmware instead. Options are wonderful things...

Chris

#12 freds

freds

    Advanced Member

  • Members
  • PipPipPip
  • 61 posts

Posted 04 October 2010 - 07:59 PM

Oh, that made me laugh ! I've done my duty, 8080, 6502, 6800, 6809, and it took me ages
to 'trust' 'C' code and libraries written by someone else.


I hear you brother!

My first machine was a army computer FADAC with rotating hard disk as registers and memory; it had about 200 circuit cards that had two flipflops on it, etc. That I hacked out programs for it on paper tape, hex machine that you programmed in octal. But hey it was a 31 bit machine for Field artillery firing data calculations.

Can't say I miss the pain; would rather use C# and concentrate on end results.

Anyway the netduino is starting to feel a little crowded with everyone pushing this or that as a capability. Of course its always implement first and optimize second when needed.

#13 hari

hari

    Advanced Member

  • Members
  • PipPipPip
  • 131 posts

Posted 05 October 2010 - 12:41 AM

Thank you for the insights. The whole world is not all nails for our easy to use Netduino hammer. It made me more aware of what are suitable tasks for Netduino and what should be handled by a 50 cent 555 Timer. Thanks everyone!

#14 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 05 October 2010 - 01:34 AM

Thank you for the insights. There whole world is not all nails for our easy to use Netduino hammer. It made me more aware of what are suitable tasks for Netduino and what should be handled by a 50 cent 555 Timer. Thanks everyone!


Well put, hari.

While there are a lot of nails you can hit with the 2-month-old Netduino hammer, there are also more to come... And thanks to community members (CW2, Pascal06, and others), you'll be able to enable additional community-created features and functionality in the platform.

Chris

#15 osno

osno

    Member

  • Members
  • PipPip
  • 17 posts

Posted 06 November 2010 - 09:41 PM

I was trying to drive several leds from a 74HCT238 at the same time, but I can't sleep a thread for less than 1 milliseconds. The effect is blinking leds all over the place. If I could sleep for, say, 500ns it will look way better. It's not possible to do that because of what's being discussed here, right? I may be able to code that in an UNO and use the chip as a LED driver (or I can learn how to use a PIC, maybe), and use the Netduino for the actual high level program.

#16 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 06 November 2010 - 09:52 PM

Hi osno, Welcome to the Netduino community. For "lots of blinking lights" types of applications, you're generally best off doing that in native code or with an accessory chip. C# code is generally best for the higher-level programming. You can also look into using the bitbanger driver: http://forums.netdui...tbanger-driver/ Does that give you a good start? Chris

#17 Michael Schwarz

Michael Schwarz

    Member

  • Members
  • PipPip
  • 21 posts

Posted 06 November 2010 - 10:02 PM

Just me two cents: the Arduino I use for projects where the hardware is the bigger part of the project, and Netduino (or any other .NET MF board) if I have to do a lot of software development. I think that building a http server or a twitter client with Arduino maybe is not as easy as doing the same job with C#. Another big benefit I have is that I do C# development since the very beginning and have many libraries I can use (without any change). Regards, Michael

#18 osno

osno

    Member

  • Members
  • PipPip
  • 17 posts

Posted 06 November 2010 - 10:13 PM

...
You can also look into using the bitbanger driver:
http://forums.netdui...tbanger-driver/

Does that give you a good start?
...


Looking into that right now. It looks promising! And thanks for the welcome and the response.




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.