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$
2
  • 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$ Apr 6, 2017 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$ Apr 6, 2017 at 14:38

2 Answers 2

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.