CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

USB HID device problems

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Futterama



Joined: 17 Oct 2005
Posts: 98

View user's profile Send private message

USB HID device problems
PostPosted: Sat Jan 12, 2008 4:20 am     Reply with quote

Hello forum,

I'm building an USB device with PIC18F2550 and the ex_usb_hid.c code example and a PC application in C# using Visual C# 2008 Express and USBHIDIO HID example from www.lvr.com.

I want to send 131072 bytes of data as fast as possible using HID. According to the ex_usb_hid.c code example, the HID is capable of sending 64000 bytes per second at full speed. This is done by sending 64 bytes in a packet, every 1ms.

I'm not sure how to build the application. I was thinking, the PC app sends a request (2 bytes) to my PIC app, and the PIC app will send one packet with 64 bytes to the PC app.
The PC would then wait 1ms and send a new request for more data and so on.

Is this the correct way of doing it?

I'm also having a bit trouble with the packet size. The ex_usb_hid.c code example says:

"...if you send a packet that is the same size as the max packet size then you need to send a 0 len packet to specify end of message marker."

So if I send 64 data bytes in one packet, the next packet would need to be a 0 len packet to indicate end of report? I have tried sending 64 bytes without sending any 0 len packet, and the PC will receive that packet, but I guess it's only receiving it because it times out waiting for the 0 len packet?

If someone with knowledge in USB could explain how to best send the required amount of data using HID, I would appreciate it.

Thanks.

Regards,
Futterama
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group