Getting Started With NETMF And Netduino

by prashant 25. June 2011 08:59
My Netduino card arrived this Sunday but I was not able to play with my new development board due to some serious "crap work" I was doing. Today I was able to run a small piece of code which blinks the user LED on the Netduino board. The code is simple enough and just like "hello world" example like we have for all other programming languages.
 
Here is my Netduino kit:
 
 
 
The best part of this development board is that it is the advanced version of the very famous Ardunio boards. Below is the detailed comparison of the three boards.
 
 
Netduino Arduino Uno Arduino Mega 2560
CPU Atmel ATSAM7X Atmel ATmega328 Atmel ATmega2560
Architecture 32-bit ARM7 8-bit AVR 8-bit AVR
Clock 48 Mhz 16 Mhz 16 Mhz
MIPS / Mhz 0.9 1 1
MIPS 43.2 16 16
Code 128 KB 32 KB 256 KB
RAM 60KB 2 KB 8 KB
Flash 512 KB 32 KB 256 KB
SRAM 128 KB 2 KB 8 KB
EEPROM 1 KB 4 KB
Pins 14 Dig. I/O (4 PWM) 14 Dig. I/O (6 PWM) 54 Dig. I/O (14 PWM)
  6 analog-in or digital I/O 6 analog-in 16 analog-in
UARTs 2 1 4
output limits 8 mA / pin & 40 mA per Pin 40 mA per Pin
16 mA / PWM
 
As you can see from the above comparison, the Netduino board is 3x faster than the Arduino and on the top it has 30x the RAM and check the processor 32-bit ARM7 awesome!!
  
Getting Started

To get started, you first need to set up your machine with some SDKs from Microsoft and Netduino. Below is the list of the SDKs you need to install on your development machine:
This is it and you are good to go with your first Netduino application. Fire Visual Studio and create new project under Micro Framework and select Netduino Application.
 
 
I have named the project Blink because we are going to blink the LED on board. As you can see there are two LEDs on the board. The one near the micro-USB indicates power (white) and the one near the onboard button is user LED (blue).
 
We are going to blink the user LED and for this I am going to use the code from the getting started guide form Netduino (nothing fancy here from my side) I am just re-using the code. below is the code you have to put inside you main method:
OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);
while (true)
{
        led.Write(true); // turn on the LED
        Thread.Sleep(250); // sleep for 250ms
        led.Write(false); // turn off the LED
        Thread.Sleep(250); // sleep for 250ms
}

Now before you hit F5 go to project properties and under .NET Micro Framework change the Transport mode from Emulator to USB. As soon as you change the Transport mode you will notice the Device has been changed from Microsoft Emulator to Netduino_Netduino. Now press F5 and the application will get deployed to your Netduino board.

 

Here is a short video of the same deployed application on my board.

[vimeo:25589162]

This is just a simple thing to do with a small but powerful development board. There are people around the globe building some amazing things with Netdunio and Arduino shields. In my next post I will show you how to erase Netduino memory for other application to deploy.

Below are some of the resources that I think you may find useful:

 

 

Comments (4)

rob
rob
3/12/2012 6:44:05 PM #

Yes the board is much faster but time a loop in Arduino and NETMF and you will see that bloated platforms are bloated platforms. There is no way around the microsoft bloat. I have had to move an entire project off the netmf platform because of this. I love the hardware though!

Eric
Eric
6/27/2011 6:54:37 PM #

This looks pretty cool. Wasn't very aware of this kind of stuff, but just checked out Netduino's website. Think I'll pick one up as well to play with.

Dave
Dave
6/26/2011 12:24:50 PM #

I've been playing with the GHI Fez Panda II. It's a similar board like net Netduino, but it was designed from the get-go to run NETMF. The Panda has an insane amount of features and it's fast. Most Arduino Shields work also with the Panda. I've used several Panda II boards to drive my Airbus A340-600 cockpit. Programming with NETMF is easy, although I have to admit that I really miss generics support.

prashant
prashant
6/26/2011 1:57:03 PM #

Arduino shields also works with Netduino. Generics missing from .NET MF is indeed not good. Here are some of the Generics missing from .NETMF: Generics StringBuilder String.Format List<T> Dictionary<Key,Value> But some of the data structures which are available are: HashTable Queue Stack ArayList hopefully we will be seeing more in the further release of .NET MF

Add Comment

*
*
 

Visit blogadda.com to discover Indian blogs Computers Blogs