Jens Kühner

Geek stuff about the .NET, Compact and Micro Framework.

July 2008 - Posts

.NET Micro Framework v3.0 SDK beta now available!

The .NET Micro Framework team announced the v3.0 SDK beta, that is now available to all developers through the Microsoft Connect website (http://connect.microsoft.com/netmf).  Simply fill out a short survey and you have full access to the downloads, newsgroup, and feedback.

Check the site for details about the RicaVision VAVE100 universal remote control (running SideShow and .NET Micro Framework) that Microsoft is giving away as part of the beta!

And remember to check the FAQ in the beta site for the most up-to-date information about hardware supported in the 3.0 beta, how to migrate projects to VS2008, and what features are supported in the current version.

v3.0 of the .NET MF SDK is planned to ship later this calendar year.

The following features are included in the first public beta:

  1. Visual Studio 2008 now supported
    .NET Micro Framework V3.0 now runs under Visual Studio 2008. Additionally, .NET Micro Framework V2.5 projects can also be built using VS 2008 and the .NET Micro Framework V3.0 (seems to work like the .NET multi targeting introduced with VS 2008)
  2. DPWS CodeGen tools
    The .NET Micro Framework v3.0 now includes a tool, MFSvcUtil.exe that can be used to generate .NET Micro Framework DPWS client proxies and DPWS Service stubs from WSDL files.
  3. USB Device support
    In addition to allowing debugging over USB, hardware running the .NET Micro Framework 3.0 can now act as USB devices using the Microsoft.SPOT.Hardware.UsbClient namespace.
  4. Stylus/Touch Panel support
    Using touchscreen-enabled hardware, or the new touchscreen emulator, you can create code that reacts when UI elements are pressed, captures “ink” for signatures or jotted notes, or handles gestures for UI navigation. You can access this functionality through Microsoft.SPOT.Touch, Microsoft.SPOT.Ink, and new extensions to the Microsoft.SPOT.Presentation namespaces.
  5. Secure Sockets support
    The .NET Micro Framework v3.0 now supports Secure Sockets Layer (*SSL) networking for secure communications.

Following features are not available in the first public beta:

  1. File system
  2. 802.11 Wi-Fi infrastructure
  3. Support for more cores and processor architectures
  4. Publicly available Porting Kit for purchase (separate product not included with the SDK)

Device Solutions has announced support for their Tahoe development kit during the v3.0 beta and GHI Electronics has announced support for their USBizi and EmbeddedMaster development kits with the v3.0 beta.

Jan Kučera has upodated his .NET Micro Framework tools and resources website

A proven and essential site (www.MicroFramework.eu) with tons of information about the .NET Micro Framework has now a better design, more and updated information, and an online shop for European citizens to get Device Solutions hardware.

Using Touchscreens with the .NET Micro Framework

Although announced for the .NET Micro Framework V3, I found a way to use touchscreens with existing WPF apps without significant modifications and put together a library.

The PointingDeviceInputProvider class
The abstract base class PointingDeviceInputProvider posses the three methods DevicePointerDown, DevicePointerMove and DevicePointerUp that all accept screen coordinates. To implement touch support you need to derive a custom input provider like TouchInputProvider and pass the coordinates to the methods. It does not matter where the coordinates come from. Beside touchscreens you can think of a mouse or even a joystick would be possible. The PointingDeviceInputProvider class handles it all.

How can I use touchscreens without changing existing WPF applications?
When you pass coordinates to the DevicePointerDown method of the PointingDeviceInputProvider class, then determines the underlying WPF control on the screen and sets the focus to the element. Then it sends a Select-key down-event to the control.
If you have a button element with nested elements like text and you want to have your button focused, you need to disable all the child elements to prevent one of them to get the focus instead of the surrounding button.
To add touchscreen support to your WPF application you just need to have a device with a touchscreen like the Hi-CO.ARM9 from emtrion and add a concrete input provider implementation like the emtrion.SPOT.Input.TouchInputProvider class instead or in addidtion to a GPIOInputProvider object.

emtrion`s HiCO-ARM9 hardware
emtrions HiCO-ARM9 with touchscreenIn the following you can see the emtrion.SPOT.Input.TouchInputProvider implementation based on the PointingDeviceInputProvider and using emtrion´s managed touch drivers:

//universal TouchInput Provider for Emulator and ADS7843 on HiCO.ARM

//written by Jens Kühner

using System;

using Microsoft.SPOT;

using Microsoft.SPOT.Presentation;

using Kuehner.SPOT.Input;

using Microsoft.SPOT.Hardware.HiCO_ARM9;

 

namespace emtrion.SPOT.Input

{

    public class TouchInputProvider : PointingDeviceInputProvider

    {

        public TouchInputProvider(PresentationSource source)

            : base(source, false)

        {

            TouchDriver.Init(new ADS7843());

            TouchDriver.AddHandler(
                new TouchDriver.TouchEventHandler(PenDown));

        }

 

        private void PenDown(TouchDriver.Event rEvent, object rId)

        {

            int x = rEvent.Pos.X;

            int y = rEvent.Pos.Y;

 

            //we currently only get a down event,
            //so simulated down and up

            DevicePointerDown(x, y);

            Thread.Sleep(20);

            DevicePointerUp(x, y);

       }

    }

Emulating a touchscreen
emtrion HiCO-ARM9 emulator with touch supportIt is even possible to emulate a touchscreen with the .NET Micro Framework extensible emulator. The following figure shows the emtrion´s HiCO-ARM9 hardware emulator with touchscreen support. You can simulate touch events by clicking the emulator display with the mouse.

Extended touch support
If you need an even better support than just simulating key events, you need to implement a custom WPF element that implements the Kuehner.SPOT.Input.IExtendedPointDeviceControl interface with the methods OnPointerDown, OnPointerUp, and PointerMove. The attached sample include a paint box sample to show that feature.

Conclusion
To play with touchscreen support and the .NET Micro Framework, you can download my touchscreen sample projects including an emulator, the button sample and paint box sample.
Further you should visit the emtrion's support area, where you can download their nice touch-enabled HiCO-ARM9 emulator and sample code.
Soon I will post how to use GHI Electronics EmbeddedMaster hardware to use a mouse or joystick to interface with WPF applications.

Data acquisition with SPI and the MF

Carlo Mendoza has a .NET Micro Framework related post about data acquisition with SPI.