writing usb driver in visual C#.Net.?
-
How can i write usb driver software for microcontrollers? i have a poject with microcontroller. When my project connects with usb cable to PC so i want my software connects with microcontroller.i want to send data and get data from microcontroller. i wish i could explain my aim. for example when i click a button in PC side(in visual studio or delphi etc.) so microcontroller and pc can send-get datas with usb cable.
Mir_As wrote:
How can i write usb driver software for microcontrollers?
Using C#?? You can't. The microcontroller cannot run the .NET Framework, so any C# code you write will also not run. You can write an app to talk to something on the microcontroller, but whatever you write for the micro will most likely have to be written in C, not C#. How you do the communication depends entirely on the micro and how you expose the data to the outside world. It's entirely up to you.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
Mir_As wrote:
How can i write usb driver software for microcontrollers?
Using C#?? You can't. The microcontroller cannot run the .NET Framework, so any C# code you write will also not run. You can write an app to talk to something on the microcontroller, but whatever you write for the micro will most likely have to be written in C, not C#. How you do the communication depends entirely on the micro and how you expose the data to the outside world. It's entirely up to you.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...i want to write driver for my microcontroller. when i connect to microcontroller project to Pc so i want they connect eachother.and send and get datas. i think it can be.but how? serialports connect to microcontroller i think USB can connect to microcontrollers too.
-
i want to write driver for my microcontroller. when i connect to microcontroller project to Pc so i want they connect eachother.and send and get datas. i think it can be.but how? serialports connect to microcontroller i think USB can connect to microcontrollers too.
Mir_As wrote:
i want to write driver for my microcontroller
You where just explained that a task like that is geared for C, not .Net.
Check out the CodeProject forum Guidelines[^] The original soapbox 1.0 is back![^]
-
i want to write driver for my microcontroller. when i connect to microcontroller project to Pc so i want they connect eachother.and send and get datas. i think it can be.but how? serialports connect to microcontroller i think USB can connect to microcontrollers too.
What part of "you can NOT run a C# app on a microcontroller" is so difficult to understand?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
How can i write usb driver software for microcontrollers? i have a poject with microcontroller. When my project connects with usb cable to PC so i want my software connects with microcontroller.i want to send data and get data from microcontroller. i wish i could explain my aim. for example when i click a button in PC side(in visual studio or delphi etc.) so microcontroller and pc can send-get datas with usb cable.
The short answer is: NO 1. PC side if your microcontroller is to show up as a special peripheral to your PC, with an entry in the Hardware list, with multi-user capabilities, etc, then you need a device driver; such drivers can not be written in any of the .NET languages, the CLR isn't capable of doing system work. if your microcontroller: 1) would be connected through a serial port (possibly using a USB-to-RS232C cable plugged into one of your PC's USB ports), 2) would not be a multi-user device 3) would not need permanent software support then you could develop an app in any language you choose, including C#. It then couldt use the SerialPort class and go without a special driver. 2. Target side microcontrollers in general don't support .NET, and most people still believe you need .NET to run a C#-based app, so no there will not be any C# code running on the microcontroller. (One could create a cross-compiler for C# and compile it to either native or intermediate language, and come up with a small virtual machine to execute it; there is a sufficient number of small Java examples around to proof it is possible; I have not seen anyone do it for C# though). :)
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
-
What part of "you can NOT run a C# app on a microcontroller" is so difficult to understand?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...okay thats right, but what if we merge the .Net Framework with the application ?
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN% R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
----------------------------------------------- 128 bit encrypted signature, crack if you can
-
okay thats right, but what if we merge the .Net Framework with the application ?
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN% R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
----------------------------------------------- 128 bit encrypted signature, crack if you can
First, you'll have to find a compiler that will generate native code with the app and framework all rolled into one. There are some out there, but they cost a small fortune to buy. Next, that compiler will have to generate native code for the CPU in the microcontroller. That probably doesn't exist. Those compilers will generate code libraries that are significantly larger than the app itself. You'll have to make sure the MC has the storage capacity to hold such a large executable. Lastly, the .NET CLR depends on Windows, which the MC will not run.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
okay thats right, but what if we merge the .Net Framework with the application ?
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN% R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
----------------------------------------------- 128 bit encrypted signature, crack if you can
-
Xmen W.K. wrote:
okay thats right, but what if we merge the .Net Framework with the application ?
Good luck!
Like I'm gonna test ? It was just an idea. Thats it...
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN% R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
----------------------------------------------- 128 bit encrypted signature, crack if you can
-
The short answer is: NO 1. PC side if your microcontroller is to show up as a special peripheral to your PC, with an entry in the Hardware list, with multi-user capabilities, etc, then you need a device driver; such drivers can not be written in any of the .NET languages, the CLR isn't capable of doing system work. if your microcontroller: 1) would be connected through a serial port (possibly using a USB-to-RS232C cable plugged into one of your PC's USB ports), 2) would not be a multi-user device 3) would not need permanent software support then you could develop an app in any language you choose, including C#. It then couldt use the SerialPort class and go without a special driver. 2. Target side microcontrollers in general don't support .NET, and most people still believe you need .NET to run a C#-based app, so no there will not be any C# code running on the microcontroller. (One could create a cross-compiler for C# and compile it to either native or intermediate language, and come up with a small virtual machine to execute it; there is a sufficient number of small Java examples around to proof it is possible; I have not seen anyone do it for C# though). :)
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
Luc Pattyn wrote:
and most people still believe you need .NET to run a C#-based app
:wtf: You just blew my mind.
Check out the CodeProject forum Guidelines[^] The original soapbox 1.0 is back![^]
-
How can i write usb driver software for microcontrollers? i have a poject with microcontroller. When my project connects with usb cable to PC so i want my software connects with microcontroller.i want to send data and get data from microcontroller. i wish i could explain my aim. for example when i click a button in PC side(in visual studio or delphi etc.) so microcontroller and pc can send-get datas with usb cable.
You probably won't need to write your own driver (if you do you will need to delve into the dark world of C/C++). Find the most suitable USB class[^] for your device, implement that in you µC's code and you can use the Windows USB driver for that class. Many µC manufacturer's already have code available for most common scenarios (so you may not even need to code the USB implementation at the µC side) and some even have their own drivers already written for you for when the generic Windows drivers won't do. I experimented briefly with this with a PIC and the USB MIDI spec with sucess after a lot of trial and error - google will be your friend when you know exactly what to search for.
Dave
Generic BackgroundWorker - My latest article!
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Why are you using VB6? Do you hate yourself? (Christian Graus) -
The short answer is: NO 1. PC side if your microcontroller is to show up as a special peripheral to your PC, with an entry in the Hardware list, with multi-user capabilities, etc, then you need a device driver; such drivers can not be written in any of the .NET languages, the CLR isn't capable of doing system work. if your microcontroller: 1) would be connected through a serial port (possibly using a USB-to-RS232C cable plugged into one of your PC's USB ports), 2) would not be a multi-user device 3) would not need permanent software support then you could develop an app in any language you choose, including C#. It then couldt use the SerialPort class and go without a special driver. 2. Target side microcontrollers in general don't support .NET, and most people still believe you need .NET to run a C#-based app, so no there will not be any C# code running on the microcontroller. (One could create a cross-compiler for C# and compile it to either native or intermediate language, and come up with a small virtual machine to execute it; there is a sufficient number of small Java examples around to proof it is possible; I have not seen anyone do it for C# though). :)
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
Luc Pattyn wrote:
I have not seen anyone do it for C# though
A new article perhaps? ;) If you do, let me know - it would be VERY interesting!
Dave
Generic BackgroundWorker - My latest article!
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Why are you using VB6? Do you hate yourself? (Christian Graus) -
Luc Pattyn wrote:
I have not seen anyone do it for C# though
A new article perhaps? ;) If you do, let me know - it would be VERY interesting!
Dave
Generic BackgroundWorker - My latest article!
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Why are you using VB6? Do you hate yourself? (Christian Graus)No, I have no such intentions; I am happy with C# (or Java) on a PC, and C and Java everywhere else. :)
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!