.NET Framework - .Net Micro Framwork Confusion
Asked By Ale
19-Feb-07 04:52 PM
Hi,
I'm C# developer and often find myself working on a lot of USB stuff from a
managed perspective. By USB from a managed perspective, I mean performing USB
IO by means of Pinvoking windows API calls.
Anyways, I'm confused about what the .net MF actually is. Can somebody
explain what it means to me, a C# developer who often does IO with hardware?
What's the point of it? Is it meant to be used by someone like me, from
windows, or is it only meant to be used by code on chips in the device?
USB
(1)
MF
(1)
OpenNETCF
(1)
MCU
(1)
DAC
(1)
SPI
(1)
ADC
(1)
ARM
(1)
A good place to start is here:
http://msdn2.microsoft.com/en-us/embedded/bb278106.aspx
But in a nutshell, the MF is an OS that allows very small embedded
applications written purely in C# to run in a very small footprint CLR.
This could run directly on the hardware or under a host OS.
From C# you can directly set and read GPIOs as well as catch interrupts.
For more complex bus architecture stuff you'll likely need something in the
OAL. So your C# application could easily include hardware drivers to do what
you want, provided that the OAL provides you the hooks to the physical
hardware you need.
--
Chris Tacke - Embedded MVP
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--
Ale replied...
So I just read 3 chapters from a .net mf book comming out:
http://www.dotnetmicroframework.com/
SO, .net mf is essentially a replacement for writing embedded code (whatever
that may be) on devices with ARM processors?
This sounds like pretty revolutionary stuff, am I mistaken?
In theory it's not limited to ARM (the emulator is running on x86 for
example). And yes, I'd agree it's revolutionary.
--
Chris Tacke - Embedded MVP
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--
DavidConge replied...

The .NET Micro Framework brings .NET to very small devices. It provides a CLR
and al that a CLR implies (managed code, automatic garbage collection, etc).
For someone like you who deals with a lot of I/O devices, the framework makes
your life a lot easier. The reason is that the framework supports standard
communication interfaces (USB, Serial, GPIO, SPI, etc). It uses a managed
driver model that enables you to communicate with peripheral hardware over
these interfaces. To do so, you write a managed driver in C#.
So, for instance, say you have a new type of sensor that can be connected to
a GPIO. It doesn't matter that the framework wasn't initially built to
support your sensor, and you don't have to wait for drivers from Microsoft or
the sensor manufacturer. You can write one yourself, and it's usually pretty
straightforward. Once you've written the driver, your application can
communicate easily with the device.
With standard interface support and managed drivers, you can connect most
types of peripheral device to your base hardware platform as long as the
device supports the types of connections that the framework recognizes.
--
Programmer/Writer
.NET Micro Framework
Microsoft Corporation
elwol replied...
as long as the
1- if the device has type of connection as ADC/DAC which is not supported
on framework? (I did not see any reference to ADC/DAC), the MF can't access
such connection?
2- the .net MF is like any C/Basic embedded SW platform used with MCU's,
however, as C# and VS platform it is more advanced and more refined API to
use for MCU work. CAMERA (CAM) input is a very useful tool in embedded
application and for remote application.
does .net MF would be capable of havinf such capability in the future or
such is limited by the MCU?
thanks
elwolv
Many ADC/DAC devices use SPI, I2C or some propietary synchronous serial
communication, so those would be accessible (though you'd have to write a
driver for the part).
Again, depends on how the camera data comes in. If it's a mapped parallel
interface it would be a fair bit of work that only the OEM could do.
--
Chris Tacke - Embedded MVP
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--
elwol replied...
thank you chris.
1- is there is amy reference articles on how to use spi/i2c to implement
interface to ADC/DAC hardware?
2- USB is a client not a host (a posted answer) used for upload the program
to MF board.
this means USB is not implemented for general use application.
why it can not be used for general communication with peripheral devices?
For MS: does implementing a full usb capability is prohibitive on such
platform? what are the technical issues, does it require hardware
implementations? some MCU comes with USB, however, they are MCU with
dedicated USB? or MF implementation?
a hardware/SW implementation of the full USB into MF would create a major
hardware river of peripherals for the use with MF hardware platform?
if all peripherals comply with a generic usb human intefrace, would that
make the application for MF simpler what are the issue involved in
implementing generic USB?
--
elwolv
No, but I've written a few and it's pretty simple. Just pull up the data
sheet, look at the timing diagrams and write code that matches it.
Because they didn't have time and manpower to implement and test the
required OAL pieces to implement USB hosting. It's not a small or simple
task.
Ben Voigt replied...
Sounds like you are describing USB-to-go devices which can act as a client,
or host a limited subset of devices (support for hubs is optional, for
instance).
elwol replied...
thank you gentelmen for the info
USB desirability is that you can offload different hardware function to the
peripheral.
the user can select what he wants to use to augment the board/MF selected
with extra capability to use during development or as supplement to the board
function.
one feature useful for development purpose is the ability to have FS where
data is logged to an external USB Flash/HD
it is clear to me that this API with its .net presentation framework will be
a major MCU OS for ARM controllers, ovetaken C development emvironment.
the question is: are we going to be able to use the ARM/MF package as low
cost MCU to mate with other specialty controller chips, like stepper and
servo motor control specialty chips that require communication through system
data bus?
--
elwolv
Ben Voigt replied...
Seems yes -- you can interface with many busses such as I2C or SPI using
GPIO which .NETMF apparently supports, and integrators should provide
additional drivers exposing builtin peripherals such as synchronous serial
ports, counter registers, pwm, etc.

Hilfe von WMI und Registry ist es mir gelungen die VID und PID der angeschlossenen USB-Festplatten zu ermitteln. Aber nun klemmt es gewaltig. Zum ersten habe ich entdeckt, daß die HidD_GetHidGuid(guid) bin ich nicht hinausgekommen. Zum zweiten suche ich darin eine Möglichkeit, die (meiste?) USB-Devices auszulesen. Nur wirklich funktionierende Hinweise für BASIC habe ich nicht gefunden. Es müßte auch s gehen, doch auch dafür habe ich keine funktionierenden Beispiele für die Suche nach angeschlossenen USB-Devices gefunden. Auch weiß ich nicht, was in die Struktur Guid einzutragen ist, damit man zB mit HidD_GetHidGuid ein bestimmtes USB-Device findet. Aber eigentlich weiß ich zu wenig über diese Materie. Microsofts MSDN bietet eine große Anzahl von Firmen, die Libraries (auch gratis) anbieten, mit denen man sich durch die USB-Devices hanteln kann. Allerdings sind die meisten davon für C, C++, C#. Und ich kann Unten zun?chst einmal der Code zum Auflisten der HID-Ger?te. F?r die USB-Ger?te - das sind i.d.R. die USB-Controller - musst du GUID_DEVCLASS_USB verwenden (s. auskommentierte Zeile). Die GUIDs weiterer "Setup Classes" findest du Function SetupDiGetDeviceInstanceId Lib "setupapi.dll" ( _ ) As Boolean Shared Sub Main() Dim hDevInfo = SetupDiGetClassDevs(GUID_DEVCLASS_USB, "USB", IntPtr.Zero, DIGCF_PRESENT) 'Dim hDevInfo = SetupDiGetClassDevs(GUID_DEVCLASS_HID, Nothing, IntPtr.Zero, DIGCF_PRESENT) If hDevInfo = INVALID_HANDLE_VALUE Then
Using USB to interact with host .NET Framework In 4.0, can I use USB to interact with the host? For example, I'd like to be able to send the mote a request for status information, and to have that returned, via USB. .NET Microframework Discussions XP (1) Visual (1) GuruCE (1) Pack (1) Sourcery (1) Microframework (1 Descriptor (1) Blogpost (1) There were no changes regarding USB in 4.0, only USB device is officially supported, which means you can talk to a host. However, no all the Imote2. I'd like to be able to have two way communication via the usb port with the PC host that is running a C# program. If this is possible, are there any examples? - -Bill 1. Does your system have USB? 2. Does your system have 3.0 or 4.0? (if you are using VS2005 2.5) If you answer no to any of the above then you cannot use USB to communicate with a PC. You need to upgrade to a newer system. By the
muss vorerst 2 Byte ?ber die serielle Schnittstelle ?bertragen. Ist nicht ganz richtig, ist eigentlich USB. Nutzen tue dazu die Serialport-Klasse, der Comport ist ein virtueller Port. Genauer h?ngt an einem USB-Anschlu? ein FT232R USB UART IC. Dieses IC wandelt den USB-Datenstrom wieder in ein RS232 Signal um. Dieses wiederum geht auf einen ATMEGA32(8-Bit fung gibt? 2.) Kann ich mir das eigentlich nicht sparen? Eigentlich m?sste doch die USB-?bertragung schon Fehler erkennen. ?ber die Verbindung vom UART zum Microcontroller mache ich mir keine Grundlagen und Alternativen etwa: http: / / de.wikipedia.org / wiki / Zyklische_Redundanzpr%C3%BCfung ja, Prinzip etwa: http: / / www.usb.org / developers / whitepapers / crcdes.pdf P.S. Oft werden 'bessere' CRCs nicht zu Laufzeit berechnet an der exakten gespiegelten Position auftreten. Nun letztendlich verlasse ich mich mal darauf, dass die USB-?bertragung schon solche Fehler feststellt. Damit w?re das ok, da ich sehr viele Bl mehr z?hlt als 512 Bytes ROM. bei ordentlichen Ger?ten (HW+Firmware, und den USB-Treibern PC-seitig) und guten, nicht zu langen USB-Kabeln sollte dies genug zuverl?ssig
Recommendations for C# USB library? .NET Framework HI All - - I have used google - tried a few, but am interested life of me, I cannot inderstand why MS does not have a native library for USB. Thx, Tom C# Discussions Class (1) NET framework (1) USB library (1) USB devices (1) Peter Duniho (1) PM (1) OP (1) Microsoft (1) Maybe it is because supporting specific USB hardware requires a device driver, and you cannot write device drivers in managed code. .NET framework do have support for USB devices that can be accessed as serial ports. .NET framework can obviously not support USB devices that requires a custom driver, because it would have no idea about what to do with it. MS could have chosen to support USB devices that uses one of the generic USB drivers (like HID), but for whatever reasons
Cannot write custom wim to USB .NET Framework I have created a custom wim and new TS's and updated the Deployment Point. I have prepared 16Gig USB thumbdrive (Lgear). When I try to copy the files over to the bootable drive I get the message Has this come up for anyone else trying to deploy from USB disk? I have even tried an external USB hard drive and get the same message. Help! Rick.M Deployment Server Discussions ZaphodThank (1 Couold (1) Minint (1) Lgear (1) Flags (1) What filesystem do you have on your USB? Regards Johan Arwidmark Microsoft MVP - Setup / Deployment http: / / www.deployvista.com Fat32. I followed this model for creating a bootable USB stick, which has worked very well for PE. Problem copying the large custom WIM image generated with imagex. Even removed all other files from USB and tried again. 7 gig wim on 14 gig stick and message indicates disk is where you go, there you are! Hello Zaphod Thank you for responding. I formated the USB in NTFS using bootsect.exe (I post this hoping to help others with similar issues