Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I program a driver for a USB device for windows platform?

I am looking for a device that reads wiring voltages via a USB interface and returns the data. How would I go about programming something to interpret this data and what language would I use?

edit: If it helps, this project is to develop a digital tachometre for older engines that don't support a comprehensive ODB2 data port. Therefore, it will read voltages on a DC circuit and have an accurate graphical interface. I have absolutely no idea where to start with all this but am determined to make it work! it's for windows.

like image 753
atomicharri Avatar asked Oct 02 '08 07:10

atomicharri


3 Answers

Cheat and use libusb. I did this for a project I've been working on for a while and wrote a C++/wxWidgets app to handle the data.

I've been thinking recently of re-writing the app on the PC in wxPython though as it's much faster for GUI development.

How you want to display / log the data? There are a lot of options available. You can do some pretty cool stuff (easily) with the OpenGL capabilities of wxWidgets whether it's 2D or 3D data representation.

like image 161
Jon Cage Avatar answered Oct 20 '22 20:10

Jon Cage


If you can I would suggest using a library like libusb, as kris and Jon Cage have suggested.

If libusb isn't going to suit your needs and you're developing for Windows you should have a look at the software that Jungo provides. Again, this moves the usb software into user space rather than requiring Windows kernel development. (edit 3: Ilya points out in the comment that Jungo is also available for Linux)

If you must do some kernel development (either Windows or Linux) then C is pretty well the only option you have. Investigate this book by Rubini for linux development. For windows driver development I can recommend this book by Oney. But I'd investigate the libusb option in preference to the driver development in both cases.


Btw. If all you are interested in is being able to measure voltages on a usb device (and writing the code isn't important) there are many products out there that will do that for you. Take a look at some of the offerings from National Instruments. These will deal with the hard work of usb and the data acquisition and give you a nice programming interface to use in your application.


(edit 2) There are also some usb-serial chips (eg. these) that can be interfaced directly to an embedded processor usig only a uart. Typically these come with drivers.

like image 27
Andrew Edgecombe Avatar answered Oct 20 '22 21:10

Andrew Edgecombe


Have a look at libusb. It is available for both Linux and Windows.

like image 39
kris Avatar answered Oct 20 '22 22:10

kris