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 support@ccsinfo.com

USB Speed

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



Joined: 18 Oct 2009
Posts: 14

View user's profile Send private message

USB Speed
PostPosted: Mon Oct 26, 2009 9:30 am     Reply with quote

I'm using bulk transfer, using usb_puts writing a 8 byte packet, using Microchip's bulk driver & dll. The execution time is horrid. I need to stream a total of 9 bytes every 400us. Right now it's taking about 4500us.

Any ideas?


Thanks
Ttelmah
Guest







PostPosted: Mon Oct 26, 2009 10:17 am     Reply with quote

Seriously, don't use bulk transfers.....

The 'point' about bulk transfers, is that they are designed to transfer _large amounts of data_, _without_ interfering with other transfers. As such, they 'defer' to just about everything else on the bus...
They are ideal for sending a lot of data to something _where timing is not critical_, but are not at all suitable if timing is an issue.

Look at the examples for keyboard/mouse transfers. These are designed to give fast response, at a cost in terms of not being suitable for moving large amounts of data.

Best Wishes
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Mon Oct 26, 2009 11:47 am     Reply with quote

A full speed host is polling the device every 1 ms for new data, so you can't send data from the device every 400 us.
Rohit de Sa



Joined: 09 Nov 2007
Posts: 282
Location: India

View user's profile Send private message Visit poster's website

PostPosted: Tue Oct 27, 2009 8:32 am     Reply with quote

FvM has rightly pointed out the maximum poll rate - the host doesn't poll faster than 1ms. However, you can reduce 4500us to a smaller number by removing all other devices on the USB bus.

Bulk mode data is low priority data - it will send data on the bus only if the transfer doesn't 'interfere' with the other transfers taking places simultaneously on the bus (that is one of the reasons why, if you have multiple devices on a USB bus, and you try to transfer files from a USB harddisk the transfer rate slows down tremedously). Remove all other devices on the bus.

Rohit
chrispol



Joined: 18 Oct 2009
Posts: 14

View user's profile Send private message

PostPosted: Wed Oct 28, 2009 8:04 am     Reply with quote

Right now i'm doing bulk transfer of a 512k packet, so buffering a bunch of data then sending it out, but you notice a hiccup when it sends out data, maybe i will try the same method on hid.
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