Varying USB Latency


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2008
    Posts
    6

    Question Varying USB Latency

    USB latency seems to vary from about 1 msec to 15 msec and back to 1 msec every few seconds like a heartbeat; very regular! Using a 4550, PBP easy-HID template and a loop of writebacks from VisualBasic/Xp. Anyone have any ideas why? I need reliable low latency for this app.

    Wayne

  2. #2
    Join Date
    Dec 2005
    Location
    So Cal and loving it
    Posts
    40

    Default Probably not a help...

    Hi wayne,

    I'm not 100% sure what you are describing so correct me if im wrong..
    As I undersatand it, you are sending data from a pic which is recieved by the PC application and then the application sends data back to the pic, and you are seeing the 1 - 15ms difference between the transfers or vice-versa.
    If this is correct and from what I have gathered, HID is not an exactly timed data transfer method. The PC will try to service the report request within the time asked for by the device as specified in the descriptors. The pic will only transfer/receive HID data when it has received a in/out report request from the PC.
    I had an issue when I made a pic scope, where I could not transfer the data fast enough and got glitches in the waveform displayed in Visual Studio.
    I'm not sure what you need to acheive, but it sounds like you may need to look into inturrupt or asyncronous transfer for a more reliable data packet request time.
    You can also use ping pong buffering so that data is always ready to be send but I have no idea if PBP handles these - I doubt it does.
    I'm not an expert and may not have understood you correctly but I'm sure someone else will come along and help you out.

    Paul
    +-------------------------------------------------------------------+
    | PBP 2.47/2.50 | MCS+ 3.0.0.5 | U2 Prog | Vista x64 | NO SLEEP!!!!!!! |
    +-------------------------------------------------------------------+

  3. #3
    Join Date
    Feb 2008
    Posts
    6

    Question USB Latency

    Paul,

    You are correct, the pc seems slow to respond sometimes at it's own whim, same as you experienced with your pic-scope. You mentioned interrupt or asyncronous transfers as a solution; do you know how to modify the easy-HID template to do them, or do you have to start over with a different approach?

    Wayne

  4. #4
    Join Date
    Dec 2005
    Location
    So Cal and loving it
    Posts
    40

    Default No idea!!

    Wayne,

    I'm affraid not, I have been trying to modify the core assembler files and come up with PBP code to handle interrupt transfers for an outstanding project of mine but without any luck. No ones else on here seems to have a solution either so it looks like were on our own. I'm about to start packing my stuff up for a move back to the States so wont be able to work on this for a while.
    You may have to look into something like Jungo, but your looking at $$.

    I will be keeping an eye out on the internet for an answer and if I find something, Ill give you a shout.

    Paul
    +-------------------------------------------------------------------+
    | PBP 2.47/2.50 | MCS+ 3.0.0.5 | U2 Prog | Vista x64 | NO SLEEP!!!!!!! |
    +-------------------------------------------------------------------+

  5. #5

    Default

    The only way you can be guaranteed low latency is to establish an isochronous connection. The USB bus is assigned bandwidth on a first come first served basis, with the exception of isochronous connections, which receive guaranteed bandwidth if possible.
    Tim Barr

Similar Threads

  1. USB CDC Communications for Dummies!
    By Squibcakes in forum USB
    Replies: 104
    Last Post: - 15th January 2014, 13:43
  2. USB Bootloader.
    By HenrikOlsson in forum USB
    Replies: 22
    Last Post: - 2nd May 2013, 02:46
  3. Simple USB Comms Problem
    By awmt102 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 6th January 2010, 20:17
  4. One USB keyboard to Two USB Ports
    By picnaut in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th June 2009, 00:04
  5. USB PIC without USB Connection
    By Tissy in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 26th December 2005, 17:39

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts