max knor developer evangelist microsoft Österreich embedded development mit.net oder „small is...
TRANSCRIPT
![Page 1: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/1.jpg)
.NET MicroFramework
Max KnorDeveloper EvangelistMicrosoft Österreich
Embedded Development mit .NET oder „Small Is Beautiful“
![Page 2: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/2.jpg)
Windows MobileSmartphone
Functionality
Windows Vista
Tablet PC
Windows MobilePocket PC Phone
.NET Micro Framework
Notebook PC
Windows Automotive
Portable Media Centre
VoIP Phones
MobileHandhelds
GatewaysSet-top Boxes
Medical DevicesWindows-based
Terminals
Thin Clients
Entertainment Devices
Retail Point-of-Sale
Office Automation
ATMs / Kiosks
Industrial Automatio
n
Set-top Box
WearableDevices
AuxiliaryDisplays
Remote Controls
Sensor Networks
Windows XP Embedded
Windows CE
![Page 3: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/3.jpg)
Embedded Devices
Embedded Devices are tiny platformsRemote ControlsData loggersDevice ControllersSingle Purpose Device
The processor is there just to drive the device
High volume/ Low costNo need for an operating System
![Page 4: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/4.jpg)
Writing Embedded Code the „old“ way
C or C++ with low abstraction levelDifferent tools and device driversDebugging ?!Emulation / Testing ?!Reusability ?!
![Page 5: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/5.jpg)
.NET Micro Framework
„.NET way of dev“ for Embedded Devices
Same language: C#Managed environmentFamiliar APIsVisual Studio IDEHardware Emulators
![Page 6: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/6.jpg)
What’s the .NET Micro Framework?
.NET on a “TINY Footprint” device<400 KB of RAMNo memory management hardwareNo Operating SystemApplications run from Flash memory (EEPOM)
Subset of the full .NET Framework
![Page 7: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/7.jpg)
.NET Micro Framework Context
.NET Micro Framework
Windows CE Windows XP Embedded
Windows Vista
Device Features
Connected, Small, Wearable, Graphical UI
Connected, Graphical UI, Server, Browser, RAS DirectX
PC Class Performance, PC Class Networking
PC Class Performance, PC Class Networking
Footprint ARM 7, ARM 9, No MMU, 250-500KB, Managed Code
X86, MIPS, SH4, ARM, with MMU, 12 MB Managed Code
X86 X86 Dual Core, 64 Bit, Multi Processor
Power Very Low Power
Low Power Mains Mains
![Page 8: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/8.jpg)
Special in execution
C# code compiled to MSIL code
MSIL code compressed to .PE file (MetaDataProcessor.exe)
MSIL code gets interpreted at runtime(NOT JIT compiled!)
For code: normal .NET assembly
![Page 9: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/9.jpg)
Hardware Access
No strange bitmasks or control registers
.NET MF provides abstraction
Object Model with classes, events, …
![Page 10: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/10.jpg)
Reading from a pin
// Which pin to connectCpu.Pin pin = Cpu.Pin.GPIO_Pin3;
// Create a port connected to a pinInputPort port = new InputPort(
pin, //CPU pin false, //no glitch filter
Port.ResistorMode.PullUp //resistor mode is up);
// Read from the pinIf (port.Read())
Debug.Print(“signal high”);
![Page 11: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/11.jpg)
Switch on the light
demo
![Page 12: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/12.jpg)
No Operating System ?!
.NET Micro Framework works without OS
Native execution using bootable runtime system
![Page 13: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/13.jpg)
.NET Micro Framework Architecture
![Page 14: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/14.jpg)
Runtime Features
Serialization~60% smaller than .NET Framework
ReflectionRemote Procedure Call (RPC)
Invoke methods on remote objects (.NET Micro Framework custom implementation )
SecurityXTEA (symmetric), RSA (asymmetric)
Exception handlingDelegates / multicast delegates
Typed Function pointersEnables events dispatching and event driven programming vs. poll driven
NetworkingSupport for wired and wireless EthernetSockets from System.Net namespace
Managed DriversC# implementations of GPIO, PWM, VTU32, I2C, SPI bus and USART
![Page 15: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/15.jpg)
.NET Framework
Services•Description•Discovery•Protocols
UI Controls•HTML•Web
Runtime• Interop•Remoting•Serialization
Design
ConfigurationCache
Session stateSecurity
ImagingDrawing 2D
TextPrinting
DesignADO.NET
SQL ServerCESQL Client
Xslt/XPathXML Document
Reader/writersSerialization
Service process
Configuration
ThreadingDiagnostics
Net
IO
ResourcesReflection
Security
Collections
GlobalizationText
Component model
System.Drawing
System.Windows.FormsSystem.Web
System.Data System.XML
System
![Page 16: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/16.jpg)
.NET Compact Framework
Services•Description•Discovery•Protocols
UI Controls•HTML•Web
Runtime• Interop•Remoting•Serialization
Design
ConfigurationCache
Session stateSecurity
ImagingDrawing 2D
TextPrinting
DesignADO.NET
SQL ServerCESQL Client
Xslt/XPathXML Document
Reader/writersSerialization
Service process
Configuration
ThreadingDiagnostics
Net
IO
ResourcesReflection
Security
Collections
GlobalizationText
Component model
System.Drawing
System.Windows.FormsSystem.Web
System.Data System.XML
System
![Page 17: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/17.jpg)
.NET Micro Framework
Services•Description•Discovery•Protocols
UI Controls•HTML•Web
Runtime• Interop•Remoting•Serialization
Design
ConfigurationCache
Session stateSecurity
ImagingDrawing 2D
TextPrinting
DesignADO.NET
SQL ServerCESQL Client
Xslt/XPathXML Document
Reader/writersSerialization
Service process
Configuration
ThreadingDiagnostics
Net
IO
ResourcesReflection
Security
Collections
GlobalizationText
Component model
System.Drawing
System.Windows.FormsSystem.Web
System.Data System.XML
System
![Page 18: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/18.jpg)
Emulator Architecture
Microsoft.SPOT.Hardware.peMicrosoft.SPOT.Emulator.dll EmulatorNative.dllMicrosoft.SPOT.Native.pe
Microsoft.SPOT.Graphics.pe
MFApplication.pe
MyEmulator.exe UI
MyComponent
EmulatorComponentsSpiDeviceSpiDeviceSpiDeviceGpioPortSpiDeviceSpiDeviceSpiDeviceGpioPort
my.config
ConfigurationEngine
x86
HAL
/ PA
L
Tin
yCLR
(x86
)
![Page 19: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/19.jpg)
Versus Actual Hardware
Microsoft.SPOT.Hardware.pe
Microsoft.SPOT.Native.pe
Microsoft.SPOT.Graphics.pe
MFApplication.pe
HAL
/ PA
L
Tiny
CLR
![Page 20: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/20.jpg)
Device Emulator„SWITCH(!) on the light“
demo
![Page 21: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/21.jpg)
Graphical Display Facilities
Two levels of display provisionSimple bitmap support
Images, shapes, simple text rendering and wrapping
Windows Presentation Foundation
WPF based display elementsNo XAML/Just Object Model
![Page 22: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/22.jpg)
Persistent Storage
No file system for Micro FrameworkStore information in memory using standard .NET objects and value typesMicrosoft.SPOT.ExtendedWeakReference
Maintain data between sessionsPriority levels ID value = “filename”
![Page 23: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/23.jpg)
WPF UIPersistence
demo
![Page 24: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/24.jpg)
Code Challenges
Power RequirementsOnly execute code when necessaryReduce Thread.Sleep: use interrupts/events
Debugging and Performance TuningDebug.Print uses approx. 30ms of CPU time
Aggregate statisticsSubtract Debug.Print time
![Page 25: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/25.jpg)
Summary
.NET Platform for Embedded Devices
No operating system necessary
Customizable Emulator Environment
WPF subset for LCD displays
![Page 26: Max Knor Developer Evangelist Microsoft Österreich Embedded Development mit.NET oder „Small Is Beautiful“](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649d9d5503460f94a87168/html5/thumbnails/26.jpg)
© 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.