2
$\begingroup$

In Windows is it possible to write a simple program to read the binary value of a USB port without going thru a USB driver?

$\endgroup$

closed as off-topic by Carl Witthoft, Mark, hazzey, Fred, Nick Alexeev Apr 8 '17 at 2:11

  • This question does not appear to be about engineering, within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ The short answer is yes. But Suggest you add more details to the question. I am assume this question is related to How to transition from battery to USB in a microcontroller?. In which programming language, assembly, C/C++, VB etc. Looks like you simple goal is collect data using a PIC micro controller and load the data into a computer running windows. $\endgroup$ – Mahendra Gunawardena Apr 6 '17 at 11:37
  • 3
    $\begingroup$ I'm voting to close this question as off-topic because This is a software question, probably best suited to StackOverflow (when reworded) $\endgroup$ – Carl Witthoft Apr 6 '17 at 14:38
5
$\begingroup$

No, at least not in any remotely modern version of Windows.

Accessing hardware directly requires kernel privilege level, which ordinary application programs don't have. Think about it. It has to be this way else one rogue process could cause all kinds of harm.

Drivers not only deal with the hardware details for you, but they also act as gate keeper to what operations applications can perform on the hardware. Actually, applications don't perform hardware operations. They send requests to drivers to perform hardware operations for them.

So no, you need a driver to access any hardware, including a USB.

$\endgroup$
4
$\begingroup$

It assumed that this question is a continuation from How to transition from battery to USB in a microcontroller?. It is also assumed that your goal is to collect data using a PIC micro controller and transfer the data to a Windows base computer.

An alternate is to use configure a UART port on the PIC micro controller to transfer data serially. Then use a FTDI based USB serial cable such as the one in the image to transfer data.

enter image description here

The data can be accessed using a serial COM port on the PC. The USB port will be enumerated as a RS232 standard COM port. This will also help you create simple C program too.

This alternate solution will solve your 3V and 5V predicament from the other question.

References:

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.