Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[Help] reading USB port

Status
Not open for further replies.

syeda amna

Full Member level 4
Joined
Jun 1, 2010
Messages
222
Helped
24
Reputation
48
Reaction score
22
Trophy points
1,308
Location
Pakistan
Activity points
2,551
hi
i want to read USB port and want to write code in C language. Can anyone guide me or give me the code in C language. plz suggest me any tutorial or refrence.
thanks
 

You cannot directly read from USB like you read from a serial port unless you are using an adapter.

USB uses different types of interfaces.
So you first need to enumerate the interfaces and depending on the type of interfaces, call it differently.

If the USB device uses interrupt interfaces, you can open and read it directly using CreateFile/ReadFile as the drivers are already loaded. If the interface is bulk or isochronous or control you must have/write a driver.
 
You cannot directly read from USB like you read from a serial port unless you are using an adapter.

USB uses different types of interfaces.
So you first need to enumerate the interfaces and depending on the type of interfaces, call it differently.

If the USB device uses interrupt interfaces, you can open and read it directly using CreateFile/ReadFile as the drivers are already loaded. If the interface is bulk or isochronous or control you must have/write a driver.
thank you very much. very helpful fir me. can you give any tutorial or refrence material??
for writing the driver what will be the requirements?
 

please guide me. can anyone give me the code for usb interrupt interface.
 

did you anytime check my link in the thread.

https://www.delcomproducts.com/downloads/USBPRGMNL.pdf . i am reposting it

you have the code in this document... Assuming that you know about USB ,, i expect you wont get any simple program to nderstand it because ,, it not like the simple drivers that we write for controllers and its interfaces....

its high level programming concept which may require some expertise to understand.... it took 7 years for me to understand and write code for digital cameras and USB HID's..
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top