How to read from USB without any driver?

前提是你 提交于 2019-12-14 03:54:58

问题


We are creating small system which has GPS receiver and PC. We want to test my GPS receiver, We do not want to go for a driver on the first go. First I would like to test my circuit works or nor. GPS IC has been set to output NMEA sentence. We want a program which just reads data from USB port and print it on the screen.

Can we write something like this easily ? Do we have any open source tool which will achieve this purpose ?

Platform : Windows 7


回答1:


All devices need a driver, so I'm going to interpret your question as "how can I read NMEA data from my GPS using only drivers provided by the OS, so I don't have to write my own?"

If the GPS chip has a USB interface, then you should have gotten a driver with it. But most GPS chips have a UART interface which in your case sounds like it is connected to a separate USB-UART conversion chip. That conversion chip most likely came with a driver as well, but if not, you could jumper the reset pin of the converter chip, disabling it, and then attach a TTL/RS-232 level converter (available off-the-shelf) to the UART traces and then to your computer's serial port.

Unless you suspect that the driver for the USB-UART converter is causing problems, I wouldn't bother.




回答2:


Anything connected via USB is a device. Devices require a device driver, period.

You might be able to get away with an existing driver built into Windows. This is how USB memory keys work for example - they present a generic device that looks like a removable disk, and Windows already includes the drivers for generic removable disks.

You would need to check the documentation for your device to see if it can emulate a device which already has drivers. Otherwise you must install the company's drivers, or you're out of luck.




回答3:


Have a look at libusb. You should be able to read the data with that and a little code. (Yes, it's a driver. I take the question to mean "without writing a driver".)




回答4:


You need a device driver for your device. Unless Windows already have a class driver for the device.

For USB devices on Windows 7 you can write a user-mode driver, see UMDF.



来源:https://stackoverflow.com/questions/4683337/how-to-read-from-usb-without-any-driver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!