1 / 26

.NET MicroFramework

Max Knor Developer Evangelist Microsoft Österreich. .NET MicroFramework. Embedded Development mit . NET oder „Small Is Beautiful “. Thin Clients. Windows Mobile Smartphone. Industrial Automation. ATMs / Kiosks. Windows Mobile Pocket PC Phone. Sensor Networks. Windows Automotive.

sinclair
Télécharger la présentation

.NET MicroFramework

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Max Knor Developer Evangelist Microsoft Österreich .NET MicroFramework Embedded Development mit .NET oder „Small Is Beautiful“

  2. Thin Clients Windows Mobile Smartphone Industrial Automation ATMs / Kiosks Windows Mobile Pocket PC Phone Sensor Networks Windows Automotive Office Automation Retail Point-of-Sale Tablet PC AuxiliaryDisplays Portable Media Centre Medical Devices VoIP Phones Windows-based Terminals Mobile Handhelds Remote Controls Set-top Boxes Entertainment Devices Notebook PC Gateways Set-top Box WearableDevices .NET Micro Framework Windows XP Embedded Windows CE Windows Vista Functionality

  3. Embedded Devices • Embedded Devices are tiny platforms • Remote Controls • Data loggers • Device Controllers • Single Purpose Device • The processor is there just to drive the device • High volume/ Low cost • No need for an operating System

  4. Writing Embedded Code the „old“ way • C or C++ with low abstraction level • Different tools and device drivers • Debugging ?! • Emulation / Testing ?! • Reusability ?!

  5. .NET Micro Framework • „.NET way of dev“ for Embedded Devices • Same language: C# • Managed environment • Familiar APIs • Visual Studio IDE • Hardware Emulators

  6. What’s the .NET Micro Framework? • .NET on a “TINY Footprint” device • <400 KB of RAM • No memory management hardware • No Operating System • Applications run from Flash memory (EEPOM) • Subset of the full .NET Framework

  7. .NET Micro Framework Context

  8. Special in execution • C# codecompiledto MSIL code • MSIL codecompressedto .PE file (MetaDataProcessor.exe) • MSIL codegetsinterpretedatruntime • (NOT JIT compiled!) • Forcode: normal .NET assembly

  9. Hardware Access • No strange bitmasks or control registers • .NET MF provides abstraction • Object Model with classes, events, …

  10. Reading from a pin // Which pin to connect Cpu.Pin pin = Cpu.Pin.GPIO_Pin3; // Create a port connected to a pin InputPort port = new InputPort( pin, //CPU pin false, //no glitch filter Port.ResistorMode.PullUp //resistor mode is up ); // Read from the pin If (port.Read()) Debug.Print(“signal high”);

  11. Switch on thelight demo

  12. No Operating System ?! • .NET Micro Framework works without OS • Native execution using bootable runtime system

  13. .NET Micro Framework Architecture

  14. Runtime Features • Serialization • ~60% smaller than .NET Framework • Reflection • Remote Procedure Call (RPC) • Invoke methods on remote objects (.NET Micro Framework custom implementation ) • Security • XTEA (symmetric), RSA (asymmetric) • Exception handling • Delegates / multicast delegates • Typed Function pointers • Enables events dispatching and event driven programming vs. poll driven • Networking • Support for wired and wireless Ethernet • Sockets from System.Net namespace • Managed Drivers • C# implementations of GPIO, PWM, VTU32, I2C, SPI bus and USART

  15. .NET Framework System.Web System.Windows.Forms • UI Controls • HTML • Web • Services • Description • Discovery • Protocols Design Component model System.Drawing Drawing 2D Printing Cache Security Imaging Text Configuration Session state System.Data System.XML XML Document Serialization ADO.NET SQL Client Xslt/XPath Reader/writers Design SQL ServerCE System Collections IO Configuration • Runtime • Interop • Remoting • Serialization Security Net Service process Text Reflection Diagnostics Globalization Resources Threading

  16. .NET Compact Framework System.Web System.Windows.Forms • UI Controls • HTML • Web • Services • Description • Discovery • Protocols Design Component model System.Drawing Drawing 2D Printing Cache Security Imaging Text Configuration Session state System.Data System.XML XML Document Serialization ADO.NET SQL Client Xslt/XPath Reader/writers Design SQL ServerCE System Collections IO Configuration • Runtime • Interop • Remoting • Serialization Security Net Service process Text Reflection Diagnostics Globalization Resources Threading

  17. .NET MicroFramework System.Web System.Windows.Forms • UI Controls • HTML • Web • Services • Description • Discovery • Protocols Design Component model System.Drawing Drawing 2D Printing Cache Security Imaging Text Configuration Session state System.Data System.XML XML Document Serialization ADO.NET SQL Client Xslt/XPath Reader/writers Design SQL ServerCE System Collections IO Configuration • Runtime • Interop • Remoting • Serialization Security Net Service process Text Reflection Diagnostics Globalization Resources Threading

  18. Emulator Architecture Microsoft.SPOT.Emulator.dll EmulatorNative.dll Microsoft.SPOT.Hardware.pe Microsoft.SPOT.Native.pe EmulatorComponents Microsoft.SPOT.Graphics.pe x86 HAL / PAL SpiDevice SpiDevice MFApplication.pe SpiDevice GpioPort SpiDevice SpiDevice SpiDevice GpioPort TinyCLR (x86) ConfigurationEngine MyEmulator.exe UI my.config MyComponent

  19. Versus Actual Hardware Microsoft.SPOT.Hardware.pe Microsoft.SPOT.Native.pe Microsoft.SPOT.Graphics.pe HAL / PAL MFApplication.pe TinyCLR

  20. Device Emulator„SWITCH(!) on thelight“ demo

  21. Graphical Display Facilities • Two levels of display provision • Simple bitmap support • Images, shapes, simple text rendering and wrapping • Windows Presentation Foundation • WPF based display elements • No XAML/Just Object Model

  22. Persistent Storage • No file system for Micro Framework • Store information in memory using standard .NET objects and value types • Microsoft.SPOT.ExtendedWeakReference • Maintain data between sessions • Priority levels • ID value = “filename”

  23. WPF UIPersistence demo

  24. Code Challenges • Power Requirements • Only execute code when necessary • Reduce Thread.Sleep: use interrupts/events • Debugging and Performance Tuning • Debug.Print uses approx. 30ms of CPU time • Aggregate statistics • Subtract Debug.Print time

  25. Summary • .NET Platform for Embedded Devices • No operating system necessary • Customizable Emulator Environment • WPF subset for LCD displays

  26. © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related