Welcome to Pete Brown's 10rem.net

First time here? If you are a developer or are interested in Microsoft tools and technology, please consider subscribing to the latest posts.

You may also be interested in my blog archives, the articles section, or some of my lab projects such as the C64 emulator written in Silverlight.

(hide this)

First Experiences with the new Netduino GO, and how it relates to .NET Gadgeteer

Pete Brown - 07 April 2012

I just received a bunch of packages from both Secret Labs and GHI Electronics. The Secret labs packages contained their brand new Netduino GO. The GHI package contained the FEZ Cerebus Starter kit I ordered.

This post looks at the new Netduino GO and briefly compares it to the .NET Gadgeteer (Cerebus and others). I also build a couple simple example applications using the Netduino GO kit.

The Hardware

the hardware came in a number of classic Netduino Blue boxes, with each board and module inside packaged in quality ESD-proof bags. Secret Labs has always had a good unboxing experience. I've also really like these bags as they just seem to be quality.

Disclosure: These bits were provided to me free, from Secret labs. I also purchased $150 worth of GO modules from Nwazet using my own money. You may remember them from the PIX-6T4 and my game: Sixty4Racer. The Nwazet modules, including a touch screen, should arrive later this coming week.

Also, keep in mind that although I work for Microsoft, Microsoft doesn't make a dime off any of these devices. It is all free and open source (Apache licensed). The .NET Micro Framework 4.2 is actually 40% community contributed as well.

Here are some photos of the packaging and modules.

image image image

The downside to the packaging is you end up with a lot of blue boxes hanging around. I haven't yet figured out a good use for those, although I employ one or two on my bench to hold loose screws and whatnot. I'm not sure how Secret Labs plans to package up kits, but it would probably be more environmentally friendly to put all the individually wrapped modules in a single box for shipping.

The Netduino GO modules have their mounting holes on 5mm centers, just like the Gadgeteer. So, I was able to use a Tamiya 70172 Universal Plate (Large) as a home for everything.

image

Top to bottom, left to right:

  • RGB LED Module
  • Netduino GO main board
  • Netduino Shield Base (for using arduino/netduino shields with the GO)
  • Button module
  • Button module
  • Potentiometer module

The Netduino GO board came with a couple 10 wire cables, but the modules themselves did not. The ribbon cables with the red stripes on them are extras from my Gadgeteer cables. I'm a bit torn in that I think each module should come with a cable, but at the same time, those cables tend to be expensive, and I do have an awful lot of extras lying around because each Gadgeteer module comes with a cable. I'd be interested in your thoughts and expectations here.

In any case, make sure you order some extra cables if you plan to hook up more than a module or two at a time.

If you look closely at the modules on my dev board, it looks suspiciously like Gadgeteer. In fact, here's a GHI Cerebus on the same type of mounting board:

image

Also shown in this picture is my MIDI module (I plan to release a version for the Netduino GO as well)

Superficially, they look almost identical. The connectors are the same 10 pin micro IDC connectors. On the Gadgeteer, they're black, on Netduino, they're blue, but otherwise they are identical parts. Orientation is also 180 degrees different, but that's not really a functional difference. Here's a side x side of the Cerebus and the GO in kit form. (the kits are not equivalent in price or functionality. I just used the photos the two vendors have on their sites)

image image

It's hard to really see it from this photo, but the Netduino GO main board is just a bit than the FEZ Cerebus main board. GHI also has several other Gadgeteer main boards and kits (like the Spider and the Hydra). The Cerebus is just the latest offering. The Hydra and Cerebus are open source hardware and software, as is the Netduino GO.

The Netduino currently has provision only for USB power (although I understand there may be an adapter coming), provided directly on the main board. The Gadgeteer always has the power provided by a separate module, always colored red. The source of that power can be an adapter, USB, batteries, or something else.

Module-wise, the GO modules tend to be a bit larger as well. It appears there are a few reasons for this:

  • GO modules (so far) always have their connector on the top. To save board size, many small Gadgeteer modules have the 10 pin connector on the bottom
  • GO modules include a coprocessor chip (or module controller, or whatever you'd like to call it).

The second item brings us to the main difference in the approaches. The architecture.

The Architecture

The real difference between .NET Gadgeteer and the Netduino GO is the way the modules communicate with the main board.

Let me start by saying that I strongly believe there is merit in both approaches. I like the socket-type approach on Gadgeteer, and I also like the GO!bus approach used by the Netduino. I'm not picking sides here, just describing how they work. This is the kind of stuff holy wars are made from. Let's not go there.

Design Approach

The .NET Gadgeteer uses a socket identifier approach. Each main board surfaces a number of sockets, each of which is assigned a socket type. For example, socket type "U" is for UART (serial) communications. Socket type "A" supports analog communications. There's pin sharing and whatnot behind the scenes, all managed by the board code, but in essence, you are surfacing the MCU's different pins in the form of sockets. If a main board has, at most 6 analog inputs, you cannot get more than that without adding a co-processing board with its own MCU with its own analog inputs, communicating to the main board over serial, I2C, SPI, DaisyLink (more on that in a moment) or something else. This approach is a simplification and formalization of the pin-based approaches we've seen starting with Arduino and others.

The Netduino uses the GO!bus protocol (discussed below). The main board only provides digital communications with modules. It doesn't surface any specific pin types, and all sockets are (to the best of my knowledge) equivalent. Therefore the modules own all capabilities and the main board serves only to run your code and communicate with the modules themselves.

Communications Protocols

On the Netduino, all modules communicate with the main board using the digital GO!bus protocol. This is a chip-to-chip SPI protocol (I believe it also can work over serial if you prefer) of varying speed. I've seen mentioned speeds up to 40MHz. The on-module chips that provide this functionality are pretty cheap ($0.30 each in quantity), but have a number of capabilities. I've ordered a bunch from Digikey to experiment with. They're small format surface-mount components, though, so not exactly breadboard-friendly without a breakout board. ( Appropriate breakout boards can be ordered from Seeed and other places. Be sure the pin pitch matches the chip you're experimenting with). Secret labs is also looking to potentially expand the universe of supported (meaning they provide GO!bus code) chips to ones like AVR and more, making it easier for DIY folks to experiment.

The .NET Gadgeteer also has an I2C-based module communication protocol called Daisylink. Its primary purpose is to allow chaining a number of modules together, but it is a digital protocol implemented by a few modules including the multicolor LED module. I haven't seen any vendor-provided Daisylink module code, but some folks in the community have been working on that. Daisylink is, by far, not the most common way to create modules for the Gadgeteer, however. Most use X/Y socket types, serial, SPI, or something else.

Aside: the on-module processor approach

Before the GO was introduces, I was looking at creating a number of modules for the .NET Gadgeteer (I still am). In each case, those modules requires an on-module processor to handle things like multiplexing many inputs, handling some logic specific to the board, or something else. The on-module processor approach is actually one of the best ways to scale out a solution whether you're using the Netduino or the .NET Gadgeteer. The Netduino GO approach simply formalized it and provides tested code you can use to get started.

Using this approach, you can, for example, create a module that can be wired up to 64 buttons, or have 16 analog potentiometers, or which can control a large LED array, or a bunch of servos or anything else. It's a very valid (and sometimes necessary) approach regardless of which board you use.

Another example is my MIDI module. At its heart, it's a very simple module. However, there are certain MIDI functions, like MIDI soft thru, clock/sync generation, active sense mode, message filtering, and more which would be best implemented in native C code on an on-module processor. I may create a version of the MIDI module which works with the GO, but also provide firmware options (either different firmware or an on-module jumper or something) to enable it to communicate with the Gadgeteer as well.

Finally, the Netduino GO does allow you to use X, U, or S Gadgeteer modules in compatibility mode. Unfortunately, this ties up a number of sockets to make it work, so I suspect it will be good for emergency use only; you wouldn't want to design modules around it. You would need to create a special driver for the GO anyway, as all the Gadgeteer code infrastructure isn't there on the board firmware.

Enough of the comparison. Let's take a look at the experience of building a simple Netduino GO demo application.

Netduino GO Installation

I previously had installed the .NET MicroFramework 4.2 SDK, so I didn't have to mess around with that. I won't cover much of installation here, as the full Netduino GO SDK wasn't yet ready when I got the hardware.

Worth noting was that I didn't need a special driver for the GO. Instead, I plugged it into my machine, and it was recognized as a Netduino. It just worked.

image

Hello World: Lighting up the RGB LED

As I mentioned, I didn't have an official SDK yet, instead, I created a regular Netduino project, changed its framework version to 4.2, and then added a reference to the Netduino GO libraries sent to me by Chris at Secret labs. Presumably, with the new SDK, the experience will be File->New->Netduino GO Application.

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoGo;
using NetduinoGo;

namespace NetduinoGoFirstApp
{
public class Program
{
public static void Main()
{
var led = new RgbLed((GoBus.GoSocket)8);
led.SetColor(255, 40, 0);
}

}
}

Plug the RGB LED into any socket on the main board. (Netduino GO doesn't require you to match socket IDs or letters or anything). I used socket 8 in the example here. If you choose a different socket, just indicate that in the code.

Deploy and run that application, and you'll see a bright orange color from that LED. Those multicolor LEDs are very nice. They have excellent colors and are super bright, even at their default 33% brightness (100% would be insanely bright).

Here's the same code showing the LED in blue.

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoGo;
using NetduinoGo;

namespace NetduinoGoFirstApp
{
public class Program
{
public static void Main()
{
//var led = new RgbLed((GoBus.GoSocket)8);
//led.SetColor(255, 40, 0);

var led = new RgbLed();
led.SetColor(0, 0, 255);
}

}
}

Note that in this case I didn't specify a socket ID. I only have one RGB LED module, so it identified itself to the main board using the GO!bus, and it just worked. I really do like that particular feature of the GO!bus as it means you can move modules around without changing code. This is great flexibility, especially if you're providing something that will go into an enclosure.

Each socket has an LED next to it on the main board. The socket being used for communication glows blue when the module is used from code.

If you have more than one identical module connected, it appears that the GO!bus just picks the first one it finds.

Varying the LED color with a potentiometer

Time to kick it up a notch. The kit I received has a potentiometer module and two buttons. I want to make it so the potentiometer can be used to change the color of the LED by varying the R, G, and B components independently. Ideally this would have three potentiometers, but as I have just the one, I decided to make it so the button cycles between R, G, and B, and the potentiometer changes one component at a time.

Here's the code.

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoGo;

namespace NetduinoGoFirstApp
{
public class Program
{
private static NetduinoGo.RgbLed _led;
private static NetduinoGo.Button _button;
private static NetduinoGo.Potentiometer _potentiometer;

// r, g, b in an array
private static byte[] _colorValues = new byte[3];
private static int _colorIndex = 0;

public static void Main()
{
_led = new NetduinoGo.RgbLed();
_button = new NetduinoGo.Button();
_potentiometer = new NetduinoGo.Potentiometer();

_button.ButtonReleased += OnButtonReleased;

_led.SetColor(0, 0, 0);

while (true)
{
_colorValues[_colorIndex] = (byte)(255 * _potentiometer.GetValue());
UpdateLedColor();

Thread.Sleep(100);
}

}

// switch between R, G, and B
static void OnButtonReleased(object sender, bool buttonState)
{
_colorIndex = (_colorIndex + 1) % _colorValues.Length;
}

// set the LED color to the current selections
private static void UpdateLedColor()
{
_led.SetColor(_colorValues[0], _colorValues[1], _colorValues[2]);
}
}
}

That was pretty simple to develop. A polling loop checks the potentiometer value 10 times a second, and updates the LED at the same time. Press the button to cycle between R, G and B components.

image

In this picture, note how the Netduino has blue LEDs lit next to each active socket. This helps you visually confirm which socket your drivers are using. The tiny blue LEDs aren't as bright as they appear in this photo, that's just my camera being annoying.

Conclusion

Secret Labs has come up with an interesting new platform here. I've only begin to scratch the surface, and haven't gotten into using the shield base for Arduino/Netduino classic shields, or described the process of creating a module from scratch. I'll write about those more in the future as I play with the devices more.

Should you go with Netduino GO or Gadgeteer?

That's a tough question for sure.

Right now, the decision is going to come down to what you want to do with the devices. The .NET Gadgeteer has, by far, a much richer ecosystem of modules by GHI and Seeed. Netduino may get there, but as it was just launched this week, it's not going to happen overnight. If you want the most immediate prototyping opportunities, using an existing set of plug-and-play modules, you'll probably do better with .NET Gadgeteer right now.

The Netduino supports existing Arduino-style shields just as it always has, but just as you had to before, you'll need to write (or find code for) drivers to make those work.

Long-term, I would expect the Netduino GO to also have a very rich ecosystem of modules. Plus, the potential of those individual modules is, in my opinion, greater, as the reall processing all happens on-module.

I'm really impressed with what Secret Labs has come up with, and believe it has some real potential. I like the formalization of the on-module logic design, and the fact that Secret Labs standardized on inexpensive chipsets with free compilers, making it easier for DIY folks to create their own modules. You can count me among the people who will take a stab at creating modules or module kits for this device.

I'll show off the Netduino GO, along with the Gadgeteer main boards and modules, in my talk at the free Online p&p Symposium on April 24th. Please register.

             
posted by Pete Brown on Saturday, April 7, 2012
filed under:              

13 comments for “First Experiences with the new Netduino GO, and how it relates to .NET Gadgeteer”

  1. Chris Walkersays:
    Pete,

    Thanks for taking the time to give the new Netduino Go a spin!

    The platform is only a few days old, and there's so much coming to the platform.. Let me add a few notes of interest...

    On modules... We're excited about the launch set of six modules, and there are a few dozen more already in the works or in production. Piezo buzzer, Ethernet, and SD should be shipping soon. We've also built some extra features into the hardware which we'll utilize in free software updates (all open source).

    When we developed Netduino Go, we felt that minimizing module cost was the right thing to do. This helps enable a rich 3rd-party ecosystem of modules. Those cables are about $2 each and we didn't want to push extra cost onto the part-time module makers or to the users. We also wanted to let users pick the length of cable appropriate for their situation, and we didn't want to add unused cables to landfills.

    The blue boxes are for Amazon "frustration free packaging" so that they can ship individual items from warehouses and so that there are no scissors required to open them. Most resellers pack everything in one box. You do get the premium carbon conductive bags with each module of course.

    One of the open source hardware companies involved in the creation of Netduino Go, Nwazet, should be shipping their AC/battery-pack power module soon. Here's a link:
    http://fabienroyer.files.wordpress.com/2012/04/1_power.jpg

    I'm so excited to see what the .NET community builds with their Netduino Go boards. Combined with the new Shield Base go!module (beta), both those who love soldering irons and those who are just starting out should have a lot of fun tinkering in their future.

    Warmest regards,

    Chris
  2. Mitchsays:
    Hi Pete and Chris,

    Chris, I just bought your book "Getting Started with Netduino" and am getting ready to purchase a Netduino to play with. I was going to get the Netduino Plus but when I was at Amazon I noticed the Netduino Go and saw Pete's review which lead me here. In the book the Plus sounds like the best one but the Go wasn't released yet. Should I get the Plus or the Go?

    Pete, by the way, I have your Silverlight 5 book preordered from Manning; I haven't checked out the Meap but I am really looking forward to getting the printed copy in the mail. It's cool to find your blog and see what other cool things you are interested in.
  3. Mitchsays:
    Hi Pete and Chris,

    Chris, I just bought your book "Getting Started with Netduino" and am getting ready to purchase a Netduino to play with. I was going to get the Netduino Plus but when I was at Amazon I noticed the Netduino Go and saw Pete's review which lead me here. In the book the Plus sounds like the best one but the Go wasn't released yet. Should I get the Plus or the Go?

    Pete, by the way, I have your Silverlight 5 book preordered from Manning; I haven't checked out the Meap but I am really looking forward to getting the printed copy in the mail. It's cool to find your blog and see what other cool things you are interested in.
  4. Petesays:
    @Mitch

    Thanks for the kind words, and for ordering my book. It's in production now, so it should be in print very soon.

    If I were you, I'd get a Netduino GO and a shield base module. Then you'll have everything the Plus can do (except networking for the moment), running at a much faster clock speed, and with more expansion options. For example, you can actually connect several shield base modules to the same Netduino GO main board.

    The forum is here. I suggest reading some of the posts covering what the GO can do:
    http://forums.netduino.com/index.php?/forum/26-netduino-go/

    Also check out nwazet for the modules they've developed. You can also order from them if you prefer.
    http://nwazet.com/

    I'm planning on developing some GO!bus modules just as I have with other platforms. Tons of fun :)

    Pete
  5. Chris Walkersays:
    Hi Mitch,

    The "Getting Started with Netduino" book is written with .NET MF 4.1 in mind, so I'd probably pick up a traditional Netduino to get started.

    That said, Netduino Go is the new flagship model. They look lovely next to each other. ;)

    Chris
  6. Mitchsays:
    Thanks guys, you have been a big help. This is really awesome stuff, I can't wait to get started. Seeing what people are doing with these microcontrollers is a big inspiration. I have noticed some of the modules and kits out there require soldering, which makes me nervous, but I'm going to dive in. I just need to get some cheap parts to practice with so I don't ruin something more expensive.
  7. Russ Ramirezsays:
    Just left a comment on Amazom after purchasing a Go, but then coming here noticed that you're the "Silverlight In Action" Pete Brown. I loved your book on SL4, I recommend it all the time. Rock on!

    Russ
  8. Eric Meyersays:
    Pete,

    On the Netduino Go forums, you talked about creating modules that support both Go and Gadgeteer. Any progress in this area? While I don't expect either GHI or Secret labs to produce modules that support both platforms, I would love to see all of the 3rd party module producers doing so. Obviously not all modules are candidates for this, but I would think that many would be. That level of flexibility would be awesome. I would love to see an article on how this could be accomplished. -Eric
  9. Petesays:
    @Eric

    Yes, I'm working on it. I think it might be easier with this new secret chip Chris has mentioned on the forums, but I need to wait for more info on that.

    Some modules will target both. Once I have the pattern down, it will be relatively easy to implement. I'll definitely write up the approach I take, stumbles and all.

    Some annoyances include the sockets facing different ways (it's a "guideline" for Gadgeteer, but a mandate for the GO logo, so I guess GO wins there), as well as trying to support additional Gadgeteer socket types other than UART. Finally, GO has a mechanism for updating on-module firmware whereas Gadgeteer does not. I don't think I can tell people "to fix this bug, you need a Netduino GO", but I'm also not sure if it's reasonable to port any of that update code to Gadgeteer.

    Pete
  10. samuelsays:
    Hi, i tried the above code and (using microsoft c# express 2010) i get the following errors for each "private static" decleration. I have not altered your code in any way.


    Error 1 The type or namespace name 'NetduinoGo' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Samuel\documents\visual studio 2010\Projects\NetduinoTestApp\NetduinoTestApp\Program.cs 12 24 NetduinoTestApp


    Error 2 The type or namespace name 'NetduinoGo' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Samuel\documents\visual studio 2010\Projects\NetduinoTestApp\NetduinoTestApp\Program.cs 13 24 NetduinoTestApp


    Error 3 The type or namespace name 'NetduinoGo' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Samuel\documents\visual studio 2010\Projects\NetduinoTestApp\NetduinoTestApp\Program.cs 14 24 NetduinoTestApp

    Any ideas?
  11. Petesays:
    @Samuel

    The NetduinoGo was in preview form when I wrote this post. It's quite possible the namespace name changed before release (I can't check on this particular machine). I remember it being GoBus at one point, but I can't recall if that was before or after.

    Look at your referenced assembles in the Object Browser (under the View menu) and see what the correct namespace is.

    Of course, it's also possible that you didn't create a Netduino GO project (there's a template for that in the SDK that came out after I wrote this. As I mention above, it was all early release stuff at the time).

    Pete
  12. Dextersays:
    Hi Pete,
    I know this might be an off topic question but i'm rather new to all of this and my boss has given me the task of trying to build a almost cell phone like device that can upload data to a server it has to collect arrays and post them up so that it may all be compiled we where using cell phones for this but where wondering if we could use something like the netduino GO or something of the sort, the device would have to be change-able like maybe a bigger keypad or a touch screen maybe even colour screen etc...
    I have no clue where to start so any help from anyone would be very welcome...
    BTW I'm located in South Africa so some parts may be hard to come by...
  13. Petesays:
    @Dexter

    Without knowing more about what you need to do (how often you collect data and how often you upload, how large the data is, what the sources of the data are etc.) I'm not sure I could make a recommendation.

    Yes. Netduino and other NETMF devices can connect to the internet and upload data. Beyond that, you can store data to an SD card or something to buffer if necessary. Now, if the data is a constant stream at high volume, then these little NETMF devices may not be able to keep up. If, however, it is checking periodically, then it'll work.

    Pete

Comment on this Post

Remember me