Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: USB host always at 500 hz ?

  1. #1

    USB host always at 500 hz ?

    Hello,

    I am playing around with the usb host library,
    I've tested with a few mice which are firmware set to 1000hz (even without any drivers) but the usb host library polls each of them at 500hz.
    I watched around the sources, tried to change the interval in USBHIDParser::claim and some litle other changes, but I can't seem to find at all where this value comes from.

    Any idea ? Is that something to do with the usb host hardware timer, I saw that notion while browsing the sources ?

  2. #2
    Ok, I chcked data, interval is 1 all the time, usb dev speed is full speed.
    I then though that the fact it is stuck to 500 hz was because the periodic list table was too small for this use case.
    I tried to set the periodic list to 1024, but it didn't change anything unfortunately. I think I see my pipe added to all the cases of the array.

    I see that the periodic list size set to 1024 results in USBHS_USBCMD_FS(0); . I guess that is a direct hardware call.
    Could it be the usb controller that just don't support polling at 1000 hz ?

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,470
    Periodic list size is a false path. Larger list size is needed for very slow polling, not faster.

    If you want to investigate further, I'd recommend enabling the debug printing in USBHost_t36.h. Then uncomment this at the end of USBHost::add_qh_to_periodic_schedule

    Code:
    #if 0
            println("Periodic Schedule:");
            for (uint32_t i=0; i < PERIODIC_LIST_SIZE; i++) {
                    if (i < 10) print(" ");
                    print(i);
                    print(": ");
                    print_qh_list((Pipe_t *)(periodictable[i] & 0xFFFFFFE0));
            }
    #endif
    Then you'll be able to see if your endpoint's QH really is getting added to every single periodic table slot (which gives 1 ms polling) or every other slot (for 2 ms polling).


    If you want me to investigate, you'll need to follow the "Forum Rule" and post a program. Or if using one of the examples without *any* edits, just be clear about which code to run. And of course I need to know what USB device to use. Ideally another Teensy is best, again with exact code or clear instructions to exactly recreate the problem. If the problem only happens with a specific USB device, I need to know how to buy one. Amazon links preferred...

  4. #4
    Yes I did that to debug, but these clues you gave me about which slots are filled may help me to go forward. I simply used 1000hz mice, a zowie fk1 one and a finalmouse ultralight phantom with a modified firmware to make it 1000 hz : problem is reproduced on both so far ; I will keep investigating.
    I will follow the forum rules from now on, my bad, ty for the help :-)

Posting Permissions

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