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

Thread: Receiving 512bytes USB Raw HID packets possible with Teensy 4.X and ArduinoIDE?

  1. #1

    Receiving 512bytes USB Raw HID packets possible with Teensy 4.X and ArduinoIDE?

    Hi,

    first of all, I do not own a Teensy MCU yet, this is just a question to help me
    decide if it would make sense at all to buy one.

    What I am trying to do is:
    Use a Teensy 4.X as LED-Strip controller in combination with ArduinoIDE and the FastLED library to drive the leds and use USB Raw HID packets to send data to the MCU from a PC App that
    defines the colors for each LED.

    Currently I am using a Raspberry Pi Pico for that, BUT the used USB 1.1 PHY limits the
    packet size to 64bytes which forces me to split the data into several packets for a lot of
    LEDs to drive, so the "framerate" drops more and more the more LEDs are added.

    My hope is that Teensy 4.X's USB 2.0 PHY allows me to use larger packets (512 bytes)
    so I have to split the data up way less and improve the framerate of the driven LEDs.

    Is receiving 512 bytes USB Raw HID packets possible with Teensy 4.X and ArduinoIDE?

    Would be great if anyone would know!

    Thanks in advance!

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    11,382
    Is it possible for rawhid to do 512 byte transfers? Yes

    I experimented with it over a year ago, and did do a Pull request: https://github.com/PaulStoffregen/cores/pull/629
    Note: the PR has not been incorporated and not sure it will be.

    The only interesting thing left to decide is best way to detect the transfer size on the host.
    Associated thread: https://forum.pjrc.com/threads/68620...-add-to-system

  3. #3
    Thanks, this is exactly what I was looking for!

    Detecting the transfer size isn't required for me as I will always just send 512 byte packets,
    the PC App I am using automatically fills unused bytes with 0s.

    Just sad that such a useful change didn't make it into the production release.

    I've ordered a Teensy 4.0 to play with, will have to start digging through the core as I need
    some special features like using custom USB VID/PID and Vendor description which was pretty easy
    with TinyUSB.

    Thanks again for providing the solution to my question!

Posting Permissions

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