>

Blog

NET Framework Use Cases

NET Framework Use Cases For Embedded Development
Introduction


No alt text provided for this image


Dot NET is very scalable and efficient, particularly because of its interoperability and high performance, and is ideal for IoT system programming. .NET nanoFramework is a free and open-source platform that allows for restricted embedded devices to write controlled code applications. It is ideal for all kinds of projects, such as IoT detectors, wearables, academic proof of concept, robots, inventions of hobbyists/makers, or even complex industrial machinery. It makes development simpler, quicker, and less expensive for such platforms by providing embedded developers access to new technology and software used by developers of desktop applications.


No alt text provided for this image


To easily write code without having to think about the low-level hardware intricacies of a microcontroller, developers will leverage the strong and familiar Microsoft Visual Studio IDE and their .NET C # skills. Desktop .NET developers can feel "at home" and will use their expertise in the development of embedded systems, widening the pool of skilled embedded developers. It contains a reduced edition of the .NET Common Language Runtime (CLR) and features a subset of the .NET base level libraries together with the most common APIs used in the Universal Windows Platform (UWP) enabling code reuse from desktop apps, IoT Core applications, thousands of code samples and open source projects.

Introduction to ESP32

IoT use has become so commonplace for diverse applications in so many sectors and .NET supports hundreds of sensors, displays, and input devices and operates on a number of platforms and architectures, including prominent IoT boards such as Raspberry Pi and Hummingboard. A developer can deploy and debug the code directly on actual hardware using Microsoft Visual Studio.

WHY USE .NET NANOFRAMEWORK?
Some of .NET nanoFramework unique features:
  • It can run on resource-constrained devices with a flash of as low as 256kB and RAM of 64kB.
  • Works on bare metal, explicitly. ARM Cortex-M devices and ESP32 devices are currently supported.
  • Supports standard embedded peripherals and interconnects such as networking, GPIO, UART, SPI, I2C, USB.
  • Provides native multithreading support.
  • Help for energy-efficient activities, such as battery-operated systems.
  • Interop code support allows developers to quickly write libraries that have both maintained (C#) and native (C/C++) code.
  • No manual memory maintenance because of the simplified garbage collector for mark-and-sweep.
  • Execution limitations for capturing lockups and failures of devices.
A simple but exciting use case running .NET on ESP32

Running .NET on ESP32

Some advantages over other similar systems:

  • First-class debugger experience with breakpoints, single move, step in, step out, step over, pause and stop, right on the goal hardware.
  • Powerful and free programming environment with Microsoft Visual Studio IDE.
  • Help for a broad variety of affordable boards from many vendors, including ST Microelectronics Discovery and Nucleo boards, Mikrobus Quail, Wilderness Labs Netduino, ESP32 DevKit C, Launchpad CC3220 Texas Instruments, Launchpad CC1352, and MIMXRT1060-EVK NXP.
  • Easily expandable to other RTOSes and hardware systems. It is now targeting compatible CMSIS and FreeRTOS port ESP32.
  • Free and Open Source entirely. From the main modules to the utilities used for component development, deployment, debugging, and IDE.
USING THE.NET MICRO Platform

There are three approaches to build hardware that uses the Micro Framework:

  • The simplest and fastest way to do this is to pick a processor component that has been ported to the Micro Platform.
  • This is the turnkey approach that has all the processor initialization code already made for you. The benefits of this approach are a simplified PCB interface and supervised code creation in Visual Studio only. You don’t have to use a different production environment. There are some off-the-shelf modules available and links to them can be found on the Microsoft.NET Micro System website.
  • The second choice is to build your concept on the basis of a reference design that has been adopted by the Micro Framework. This is identical to #1, but you have a little more control over the layout and the peripherals.
  • Place the Micro Framework on your hardware. This is the most versatile option, but it is also the most difficult one. In addition to initializing the device yourself, you will be responsible for designing the Micro Framework HAL that interfaces the Micro Framework to your hardware. The good news, if you prefer this choice, is that Microsoft has qualified a range of porting partners who are available if you need their services.
ADDITIONAL ADVANTAGE

Hardware Abstraction: The virtual computer removes the hardware from the program. Some hardware modifications are localized and handled more effectively without destabilizing the whole application.

Extensible Emulator: A completely extensible emulator is given with the Micro Framework. This simulator allows you to write an extension to fully simulate your hardware, giving you the ability to fully create, test and debug your built-in application – without the hardware! Three key pieces are involved:

  • Your application for the Micro Framework that will actually run on your computer
  • The Emulator Engine used in the SDK Micro Framework
  • A Windows Desktop program that reflects your computer. This program can be as basic or as elaborate as you want. You may use winform buttons that represent actual buttons or switches on your screen, a text box or an image box that represents an LCD display, a radial button that represents LEDs, etc. It is simple to represent SPI, COMM, I2C, or any other busses, peripherals, or components on your computer using standard controls.

Ready to discuss your project? Let's Talk Contact Us