Blog

.NET MF
  Introduction
  Examples   Resources
  Licensing   Books

Electronics
  Power Supply
  Transistors   LEDs & Current

Robot Basics

FAQ

About

Digi Connect ME JumpStart Kit Hardware Emulation + Demo Code

Here is a small demo application running on a Digi Connect ME JumpStart kit, and an emulator of the kit:

I've started a new open source project for Digi Connect ME sample code, hosted on the TFS servers at CodePlex:

http://www.codeplex.com/PureRobotDigiConnect 

The Pure Robot - Digi Connect ME project demonstrates the basics of interaction with the Digi Connect ME module, as well as emulation of the JumpStart kit hardware.

Emulating Hardware
One of the main features of this project is the Digi Connect ME JumpStart kit emulator. This was an interesting exercise for me since Digi do not supply their own emulator along with the kit and I've never attempted to build an emulator before. I've created one in the solution, in a project named PureRobot.Emulators.Digi.ConnectME.JumpStart. The code is in a beta stage: it's ready to look at with the LightFun sample code being discussed; however the serial emulation UI is not complete so the other sample projects in the solution may not work as expected yet.

The emulation features of the Microsoft .NET Micro Framework (.NET MF) are very easy to work with. Essentially all you need is a few lines of .NET code, an XML configuration file and some kind of UI. You can then execute your .NET MF code against the emulator and (in theory) see the same results as you would on the actual hardware.

I've made a basic attempt at defining the hardware in the emulator XML configuration file:

http://www.codeplex.com/PureRobotDigiConnect/SourceControl/FileView.aspx?itemId=13592&changeSetId=4771

This file outlines the Input / Output (IO) capability of the Digi Connect ME module, and the memory characteristics as defined in the documentation:

Processor: 55MHz NS7520 (Digi Part no. NS7520B-1-I55)
Memory: 2 MB of Flash, 8 MB of SDRAM
IO: 5 GPIO pins, TTL (CMOS 3.3V) serial

For the user interface I used an image of the JumpStart kit board and added some overlaid bitmaps for the LEDs in the on state.

The emulator framework provides a nice set of objects to listen out for GPIO state changes. The only complexity in the UI code is that IO events will occur on another thread, so you need to synchronize with the UI thread before modifying the Windows Forms components to represent changes. When I first tried this, I used the InvokeRequired/BeginInvoke pattern of Windows Forms controls, but found the performance sucked. Instead I went for a synchronized set of integer variables which are modified by the IO thread using .NET thread synchronisation objects, then read on a timer from the UI thread - this seems to give a more realistic emulation experience.

The code for the UI form is here:

http://www.codeplex.com/PureRobotDigiConnect/SourceControl/FileView.aspx?itemId=159650&changeSetId=4771

Running the Demo Code
To run the sample code:

  • Download the Visual Studio 2005 source and open the solution
    • You might have to cancel a few dialogs that attempt to access the source control server, then choose to 'Permanently remove source control association bindings'
  • Build the solution
    • When you build the solution the emulator will be added to the registry
  • Open the Project Properties of PureRobot.Digi.ConnectME.JumpStart.LightFun -> Micro Framework tab, and set the Transport to Emulator and the Device to 'PureRobot.Emulators.Digi.ConnectME.JumpStart'
  • Set the PureRobot.Digi.ConnectME.JumpStart.LightFun to the startup project
  • Run (hit F5)
    • If everything has been successful you should see the lights flashing away on the emulator application as they do in the video above.

Please feel free to play with the code and if you have any bugs, problems or improvements please don't hesitate to contact me through comments to this post or through the CodePlex site.

Labels:


.Net Micro Framework White Papers and Resources

Since I began researching the Microsoft .Net Micro Framework (.NET MF) I've come across some very handy white papers and resources. Here's a reading list:

  • Introducing the .NET Micro Framework (Word Doc)
    A Microsoft 'Product Positioning and Technology' white paper written by Donald Thompson and Colin Miller. This white paper includes a nice discussion of the background of and business case for the .NET MF. It sells the idea that the lower development costs of using a managed environment and great tools like Visual Studio can offset the slightly higher per unit cost of using a 32-bit processor and licensing the .NET MF.
     
  • Official .NET MF Site
    • Main Site (HTML)
    • Developer Centre (HTML)
    • Official Supporting Hardware List (HTML)
       
  • Porting the .NET Micro Framework (PDF or HTML)
    A Microsoft technical white paper for device manufacturers about porting the .NET MF to their hardware platform. Includes interesting insights into the underlying framework.
     
  • Embedded Development Kit for the Microsoft .NET Micro Framework Step by Step Guide (PDF)
    A tutorial for the SJJ Embedded Micro Solutions EDK module, which includes a great introduction to the .NET MF.
     
  • Introducing Devices Profile for Web Services (DPWS) (PDF)
    Great introduction to DPWS, including an overview of the libraries, namespaces and important classes. Includes sample code for getting started with DPWS.
     
  • .NET Micro Framework on miloush.net
    A great site, full of straight forward information, sample code and discussion of the .NET MF. Particularly useful is the list of available modules including approximate prices and the product comparison page, which appear to be kept up to date as new modules are released.
     
  • The .NET MF News Group (newsreader, HTML, ATOM or RSS)
    The official newsgroup for .NET MF questions. The forum is very active, with knowledgeable people contributing to help with practical problems.
     
  • The .NET MF Team Blog (HTML, ATOM or RSS)
    From the horses mouth, news and announcements on the .NET MF.

Labels:


Microsoft .NET Micro Framework Licensing

The Microsoft .NET Micro Framework (.NET MF) is licensed differently according to the volume you will be selling. There are three basic scenarios:

Pre-licensed Modules
Several original equipment manufacturers (OEMs) have ported the .NET MF to a 'module' which can be bought prepackaged with a number of connectivity and peripheral options. When you buy a module from an OEM, the license fee has already been paid to Microsoft, and there are no licensing fees for you to consider. Just buy the module, include it in your design and you're done.

An example of a pre-licensed module is the Digi Connect ME (DC-ME-01T-MF), which can be bought for approx. USD $50, and includes the .NET MF license. For a full list of available pre-licensed modules, see the comparison chart on miloush.net.

Discrete Custom Designs for Existing Ports
If you are building a device for mass distribution, a prepackaged module from an OEM may not exactly meet your connectivity, peripheral or pricing requirements. In this case you can use one of the processors that an OEM has already ported to the .NET MF in your design. If you choose this approach, you first contact Microsoft at netmfbiz@microsoft.com and send them information about your company, project, and potential volume. They will put you in contact with processor manufacturers from whom you can buy a CPU at volume, and then Microsoft will agree a per-unit license fee for the .NET MF in your particular case. For example, in a high-volume device project you may create a discrete design around an ARM processor supported in the porting kit or using a public board support package (BSP).  You could buy processors from Arrow, Digi-Key or some other distributor, and since those processors could be used with any platform, they won't have the license built in.

New Platform Port
If you have a processor architecture which the .NET MF has not yet been ported to and you want to use the .NET MF on this platform, you can sign a 'porting agreement' with Microsoft. The porting process involves working closely with Microsoft developers to incorporate your platform into the .NET MF. Processor and microcontroller manufacturers such as ARM and NXP have been through this process, sometimes directly and sometimes through specialists in porting new architectures to the .NET MF such as Adeneo. OEMs such as Digi use these processors and microcontrollers as part of the design of their prepackaged modules. To create such an agreement contact Microsoft at netmfbiz@microsoft.com. A Microsoft technical white paper for device manufacturers about porting the .NET MF to a new hardware platform can be found here: PDF or HTML.

Labels:


Introduction to the Microsoft .Net Micro Framework

Let's start out with what the Microsoft .NET Micro Framework (.NET MF) is. In a nutshell, it's the future of embedded development. Programming microcontrollers for embedded devices has suffered through a litany of poor man's compilers, custom languages, non-standard development environments and until the arrival of the .NET MF was the province of the specialist low-level programmer. The .NET MF brings the finest development environment on Earth, Visual Studio, and managed C# to the embedded world. No other integrated development environment (IDE) even comes close to Visual Studio, and the debugging experience using C# and .NET MF directly on the device leaves other embedded IDEs for dead and buried. Using the increasingly standard ARM CPU as a platform, the .NET MF enables low-powered, high performance computing in micro sized packages.

The .NET MF is a complete re-write of the .Net common language runtime (CLR), and does not run on a host operating system. It is a 'bootable runtime', meaning that the CLR runs directly on the processor and includes a memory manager. This is a major departure for Microsoft from the existing .Net implementations in the embedded space, such as XPe and Windows CE running the .Net Compact Framework, and removes the massively bloated environment that those systems required - think 12MB->300KB, not to mention the reduced power consumption during operation.

The .NET MF includes these components:

  • Drivers for standard peripherals such as
  • XML and Web Services support
  • Parallelism with threaded applications
  • Simple persistent storage architecture
  • XML based user interface GUI framework for working with LCD screens and touch screens

Best of all, the platform is free with a licensed copy of Visual Studio and there are no runtime licensing fees: these are covered for you by most manufacturers of .NET MF modules.

Labels:


Embedded Programming with the Microsoft .Net Micro Framework Sample Chapters

Embedded Programming with the Microsoft .Net Micro Framework CoverIf you're looking for an introduction to the Microsoft .Net Micro Framework (netmf), the first three chapters of Rob Miles and Donald Thompson's book 'Embedded Programming with the Microsoft .Net Micro Framework' have been made available on the book's website.

The first chapter runs through the origins, features and benefits of the netmf. It has a nice breakdown of the architecture stack, including the CLR and hardware abstraction layers. It is 15 pages long, and gives a nice concise overview of the netmf platform.

Rob Miles is an MVP in Microsoft embedded development. He has a small space in his site for the netmf, including an interesting but slightly out of date FAQ and a forum in which you can ask netmf questions.

Donald Thompson is an architect for Microsoft Research, and was responsible for overseeing the design and management of the software, protocols, and technology strategy for SPOT which was launched back in 2002. As such he was well qualified to write this book about the netmf, which developed out of the SPOT project.

Labels:


Lowering Consumption with the .Net Micro Framework
This morning in the shower I was thinking about the importance of all the appliances in my house being connected to the Internet. To me, this is no longer a luxurious idea, it is a critical requirement.

In this world of ours we are starting to realise it is not sustainable to go on consuming as we have. Guzzling power like it is going out of fashion, is going out of fashion. It is no longer cool to have a car that does 1 mile per gallon. It is cool to have a Prius.

There are protocols now in use for communicating over the 240/120 volt power lines that arrive at every plugged in device.

What if every device's plug socket was actually a small low-powered micro computer, with functions to measure power consumption, identify the appliance being powered and control the power with a digital switch? Every single appliance in your house could have its plug changed over to one of these new plugs, and a Wifi .Net Micro Framework plug in an out of the way place could aggregate these devices into a simple web service. With all this information you could easily see the power consumption throughout the house, both whilst at home and anywhere online. You could have a small page for your house that shows your current power consumption, and maybe aggregate these pages into a site where you could run competitions for the house with the lowest consumption in your street...

Low power consumption for residential properties will be a massive industry, and fine grained control over how much you consume in your life will be a critical part of how you interact with the world in years to come. Why not use the .Net Micro Framework as a part of the solution?

Labels:


Microsoft .NET Micro Framework

I have recently become obsessed by the Microsoft .NET Micro Framework. The .Net Micro Framework is the perfect blend of tools and hardware for me, and I have jumped in head first.

I first picked up Jens Kühner's book Expert .NET Micro Framework, which is a great book: practical, to the point and not too verbose. I then skipped through Embedded Programming with the Microsoft .NET Micro Framework written by Donald Thompson, Rob S. Miles, which also has some useful information. If you're looking for a book to get into the framework I would recommend Jens Kühner's.

To get my feet wet, I bought the Digi JumpStart for Microsoft .NET Micro Framework kit, on the basis of Jens' excellent introduction to the available modules, and have been using it to experiment with the platform. I chose the Digi module because it is compact, cheap and simple.It includes a couple of GPIO's, an Ethernet port and a serial port, which will allow you a surprising amount of connectivity. I had no idea how widespread RS232 serial still is after all these years. My very first experience with communications was with an RS232 2400 baud modem, and throughout my early professional life I have worked with serial devices such as VT terminals - I thought USB must surely have killed it off by now but it seems RS232 is far from dead, with devices all over the place supporting it. Using the Digi Connect ME / Wi-ME module you can hook up to everything from a ZigBee sensor network to a full robotic platform using RS232.

With a few small test projects under my belt I can say that the Microsoft .NET Micro Framework is living up to my expectations, and more. The framework libraries are concise, logical and well designed; the hardware integration has been easy to work with and the footprint is absolutely tiny for what they have packed in. I would recommend this platform to anyone building devices, especially where quality user interface and standard XML web services integration are factors in the design.

Labels:


This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]