USB and C# in .NET Micro Framework (NETMF)

The .NET Micro Framework implements a USB device (also known as USB client) that enables your device to act as a USB device, like a mouse, keyboard, or printer. For example, a .NET Micro Framework device can function as a mouse, and after connecting to a PC can provide mouse coordinates.

Does .NET Micro Framework supports the USB host?

The USB host feature that allows you to connect other USB devices to your .NET Micro Framework device is not supported. However, .NET Micro Framework devices from GHI Electronics ( are all capable of USB host through a proprietary implemented USB host stack.

The GHI Embedded Master SDK includes a mouse sample, along with other samples, that shows how to make your device available as a virtual COM port when connected to a PC.

An extensive article that shows how to use a USB device feature with the .NET Micro Framework be found at It also covers how to write custom drivers for your USB devices.

C# and Silverlight 5 RC in Windows 8

Microsoft has delivered a new release candidate (RC) of Silverlight 5, a tool for creating and delivering rich Internet media and applications. C# 4 and C# 5 are still the most effective languages for writing the Silverlight 5 RC applications.

Pete Brown, the leader of Microsoft’s Developer Guidance Community Team in September 2011, said the Silverlight 5 RC is now available as a developer-only release, and is preparing developers for the final release later this year.

Silverlight 5 builds on the foundation of Silverlight 4 for building business applications and rich media experiences. Among other capabilities, the Silverlight 5 RC has modified video quality and performance, along with other features that improve developer productivity.
These include reduced network latency by using a background thread for networking; XAML parser improvements that speed up start-up and run-time performance; support for 64-bit operating systems; and reduced network latency by using a background thread for networking.

Does the Async CTP work with Silverlight 5 RC?

The Async CTP may work with Silverlight 5 RC, but according to Microsoft’s Stephen Toub, works effectively with Slivelight 5 Beta. The recommended procedure is to up a system with Visual Studio 2010 SP1, and install Silverlight 5 Beta and the Async CTP. After all of these installations are completed successfully, you will be able to successfully create and run new SL5 projects that uses Async CTP.

C# and Auto-Compiled LINQ Queries

The recently released Microsoft Entity Framework (EF) June 2011 CTP includes support for Auto-Compiled LINQ Queries. This allows every LINQ to Entities query to be automatically executed when compiled and placed in the EF query cache. Every time you run the query subsequently, the EF will find it in its query cache and won’t have to go through the whole compilation process again. This feature also provides a boost to queries issued using WCF Data Services, as it uses LINQ in the background.

How does it Work?

The EF will pass the nodes in the expression tree and create a hash, and become the keys used in the query cache. If it does not find the query in the cache then it will go ahead and compile it and store the compiled query in the cache for subsequent use. Each subsequent time, the hash will be calculated and find the compiled query in the tree, thus saving the compilation overhead.

Which performs faster: when the “Auto-Compiled LINQ Queries” is used or when the CompiledQuery is invoked?

The size and complexity of the application and queries will greatly influence its performance boost. By running a regular query 10 times using auto-compiled mode and 10 times where the compilation is turned off, the total time measured by Visual Studio’s profiling tools for the compiled queries is about 3 times faster than the non-compiled one.

In general, auto-compiled queries are not as fast as invoking a CompiledQuery. What we discussed here is that the new released CTP provides the performance savings for free.

C# and .NET Micro Framework (NETMF)

Microsoft’s .NET Micro Framework (NETMF) is a re-implementation of desktop .NET CLR for embedded devices with limited resources. But at the same time, the developer can enjoy the easy and rich development platform the NETMF offers, on devices with greater resources.
You can create applications that run on a range of systems from tiny devices, like remote controls, to PCs and Servers on the cloud– all with the same programming model and tools.
The .NET Micro Framework enables you to write embedded applications for small, connected, embedded devices with Visual Studio and C#. That means you can now use the same development tools and language that you use to build desktop and smart device (PDA and smartphone) applications to develop applications for microcontrollers.
What are the available .NET Micro Framework devices and development boards that you can write applications in C#?
1) Meridian CPU
You can write applications in C# using Visual Studio. The block diagram of this board is shown below:

Figure 1. Meridian CPU Block Diagram

The Meridian CPU and the .NET Micro Framework are ideal for applications such as; industrial automation, home automation, healthcare, consumer devices, retail point-of-sale, PC peripherals, and automotive applications.
2) Tahoe-II
The Tahoe-II development platform is the ideal place to start when developing small, smart, connected devices. The familiar development environment of Visual Studio enables .NET desktop programmers to work easily with this board.
The Tahoe- features a 3.5” touch-screen LCD, wired and wireless networking, USB function for interfacing to PCs, an accelerometer for innovative sensing and user interface applications. When you need to prototype a new device, the Tahoe-II has easy access to an array of expansion options; including serial ports, I2C, SPI and plenty of GPIO.
The block diagram of this Tahoe-II is shown below:

Figure 2. Tahoe-II Block Diagram

Copyright © All Rights Reserved - C# Learners