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

Thread: Quick Teensy 3.6 USB Host questions

  1. #1
    Junior Member
    Join Date
    Aug 2019
    Posts
    9

    Quick Teensy 3.6 USB Host questions

    I've just had to cobble together a quick dynamometer DAQ using a Teensy 3.6 and have a question about the USB Host. Part of the DAQ includes a serial input of weather data through an FTDI chip. After I wasted too many hours because I had got the D+ and D- wired in reverse I finally managed to get it working using UHS30 but couldn't get anything using USBHost_t36. Since it does work I just have a few quick questions to help clarify things before I implement it in my actual project.

    1. Should USBHost_t36 work with an FTDI serial device? I would prefer to use it if I can as it appears to use familiar Serial functions.
    2. Do I need any references to a USB Hub if I'm actually connecting the device directly to the Teensy?
    3. I got it all to work with the acm_terminal example from UHS30. This all seems to revolve around the MY_ACM class.
      1. USB_HOST_SERIAL doesn't seem to actually do anything, (at least in my example testing). Can this all be ignored?
      2. Should I just be creating my own class implementing UHS_CDC_ACM for my project and implementing the OnStart() and OnRelease() functions?
      3. Does UHS_CDC_ACM have available() and other functions that Arduino Serial/Stream does, or would I have to implement them if I wanted to use them? (It was late when I finally got success and I admit I haven't gone through the source yet.)

    This is my first post and I'd just like to thank all the regulars on here for the many replies to threads that I've read that have helped me with other projects!

    EDIT: Just to clarify, I did get the keyboard example working with USBHost_t36, just not the serial device stuff.
    Last edited by DaveAK; 08-23-2019 at 05:03 PM.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,459
    I can answer these first 2...

    Should USBHost_t36 work with an FTDI serial device? I would prefer to use it if I can as it appears to use familiar Serial functions.
    Yes, FTDI should work. Or at least the few that have been tested. But FTDI makes many different chips.

    Any chance you could edit USBHost_t36.h to enable to verbose debug info? If you could post that info here, it would go a long way towards someday getting USBHost_t36 improved to work with that specific FTDI chip.


    Do I need any references to a USB Hub if I'm actually connecting the device directly to the Teensy?
    No, the hub instances are only needed if you put a USB hub between the device and Teensy 3.6, or if the product you're using actually has a hub integrated inside (as some USB keyboards do).

  3. #3
    Junior Member
    Join Date
    Aug 2019
    Posts
    9
    Hey Paul, here's the debug output. The manufacturer, product and serial number all appear correct. I'm using the SerialTest sketch and just modified the baud rate to 9600. The device streams data constantly in one second intervals, so I'm expecting userial.available() to be triggered and the data received to be echoed to Serial. In testing my sketches it always seems to hang at userial.begin(9600). In this one I'm not sure it's ever getting that far as it's not showing Device connected in the serial console.

    Code:
    USB Host Testing - Serial
    sizeof Device = 36
    sizeof Pipe = 96
    sizeof Transfer = 64
    power up USBHS PHY
    port change: 10001803
        connect
      begin reset
    port change: 10001805
      port enabled
      end recovery
    new_Device: 12 Mbit/sec
    new_Pipe
    enumeration:
    enumeration:
    enumeration:
    Device Descriptor:
      12 01 00 02 00 00 00 08 03 04 15 60 00 10 01 02 03 01 
        VendorID = 0403, ProductID = 6015, Version = 1000
        Class/Subclass/Protocol = 0 / 0 / 0
        Number of Configurations = 1
    enumeration:
    enumeration:
    Manufacturer: FTDI
    enumeration:
    Product: WeatherStationV2
    enumeration:
    Serial Number: WS2JF0OH
    enumeration:
    Config data length = 32
    enumeration:
    Configuration Descriptor:
      09 02 20 00 01 01 00 80 2D 
        NumInterfaces = 1
        ConfigurationValue = 1
      09 04 00 00 02 FF FF FF 02 
        Interface = 0
        Number of endpoints = 2
        Class/Subclass/Protocol = 255 / 255 / 255
      07 05 81 02 40 00 00 
        Endpoint = 1 IN
        Type = Bulk
        Max Size = 64
        Polling Interval = 0
      07 05 02 02 40 00 00 
        Endpoint = 2 OUT
        Type = Bulk
        Max Size = 64
        Polling Interval = 0
    enumeration:
    USBHub memory usage = 960
    USBHub claim_device this=1FFF2A40
    USBHub memory usage = 960
    USBHub claim_device this=1FFF34C0
    HIDParser claim this=1FFF2040
    HIDParser claim this=1FFF2540
    HIDParser claim this=1FFF3880
    USBSerial claim this=1FFF2E80
    vid=403, pid=6015, bDeviceClass = 0, bDeviceSubClass = 0, bDeviceProtocol = 0
    09 04 00 00 02 FF FF FF 02 07 05 81 02 40 00 00 07 05 02 02 40 00 00 
    Descriptor 4 = INTERFACE
    HIDParser claim this=1FFF2040
    HIDParser claim this=1FFF2540
    HIDParser claim this=1FFF3880
    USBSerial claim this=1FFF2E80
    vid=403, pid=6015, bDeviceClass = 0, bDeviceSubClass = 0, bDeviceProtocol = 0
    09 04 00 00 02 FF FF FF 02 07 05 81 02 40 00 00 07 05 02 02 40 00 00 
    Descriptor 5 = ENDPOINT
    Descriptor 5 = ENDPOINT

Posting Permissions

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