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

Thread: Question about Teensy 4 second USB port.

  1. #1
    Junior Member
    Join Date
    Feb 2020
    Posts
    5

    Question about Teensy 4 second USB port.

    Hi,

    I have an existing project running on a Teensy 3.2 which receives commands from a PC connected via USB through a second USB port that is a FT232RL USB to TTL Serial Adapter Module connected to the Teensy I/O.

    The reason for using a second USB port on the Teensy 3.2 is so that the primary/built in port can be used to update the firmware and also drive a serial console that shows the status / debug.

    I need to make a new system so am thinking that i can use a Teensy 4 which includes a secondary USB port.

    My question is can the second USB port on a Teensy 4 be used as a standard USB port to receive commands from a PC (thus negating the need to use a FT232RL USB to TTL Serial Adapter Module connected to the Teensy I/O like i do with the Teensy 3.2).

    The documentation refers to the port as "USB Host" which infers that it intended to be a USB controller device rather than a listener (hope that makes sense)
    Are there any other components needed to use the second USB port on the T4 other than a physical port connector ?

    Many Thanks
    Jay

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,163
    There is no software to use the second port in device mode - and it would'nt make much sense..?

    Do you want a second usb-serial? That would be possible.
    There were several requests for this (from me, too) - so far I not aware of a solution that would survive a teensyduino-update.
    All these USB modifications need patching some files - and all mods are gone after every update.
    Too elaborate for me, I'm too comfortable for that.

  3. #3
    Junior Member
    Join Date
    Feb 2020
    Posts
    5
    Quote Originally Posted by Frank B View Post
    There is no software to use the second port in device mode - and it would'nt make much sense..?

    Do you want a second usb-serial? That would be possible.
    There were several requests for this (from me, too) - so far I not aware of a solution.
    Hi Frank B,

    I just want to be use the second USB port to receive serial data from a PC, and keep the primary port for firmware updates and debug.

    Are you saying that it's not possible ?

    Cheers
    Jay

  4. #4
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,163
    No i'm saying I'm not aware of any existing code for a second port.
    It's possible.
    Or even HID + Serial would help (maybe even better).

    So, if you want to dig into into...
    Fame and glory would be yours.

  5. #5
    Senior Member
    Join Date
    May 2015
    Location
    San Francisco
    Posts
    219
    Quote Originally Posted by Frank B View Post
    Do you want a second usb-serial? That would be possible.
    There were several requests for this (from me, too) - so far I not aware of a solution that would survive a teensyduino-update.
    All these USB modifications need patching some files - and all mods are gone after every update.
    I'd be interested in seeing these mods for a second virtual serial port. Have you posted them somewhere or made a pull request? (I can't seem to find them...)

  6. #6
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,163
    No I have nothing like this.
    Sorry if my English leads to misunderstandings.

    A long time ago I saw it here in the forum - for T3.2 maybe?
    But I don't like such patches - having to repeat them after every update makes me ... thirsty for beer.
    Last edited by Frank B; 02-07-2020 at 11:07 PM.

  7. #7
    Senior Member
    Join Date
    May 2015
    Location
    San Francisco
    Posts
    219
    No problem, Frank! Makes me thirsty too!

  8. #8
    Senior Member
    Join Date
    Nov 2015
    Location
    Cold hollow VT
    Posts
    128
    Using an FT232 adaptor on say serial1, or serial2 would work to receive commands on a Teensy. If you use serialEvents be sure to specify the port being used. I have done this and have also placed a serial datalogger from SparkFun on the same port to record all port activity to a flash drive.

  9. #9
    Junior Member
    Join Date
    Feb 2020
    Posts
    5
    Quote Originally Posted by grease_lighting View Post
    Using an FT232 adaptor on say serial1, or serial2 would work to receive commands on a Teensy. If you use serialEvents be sure to specify the port being used. I have done this and have also placed a serial datalogger from SparkFun on the same port to record all port activity to a flash drive.

    @grease_lighting,

    Thats how my existing project on Teensy 3.2 works now.

    My understanding from the above comments from Frank B is that it's not possible to use the second USB port on the Teensy 4.0 in device mode as currently there are are no library's that support it.
    Thats a real shame and a trick missed .... maybe PJRC can add it as a feature to the Teensy API in the future.

    Cheers
    Jay

  10. #10
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,288
    Quote Originally Posted by JayMonkey View Post
    My understanding from the above comments from Frank B is that it's not possible to use the second USB port on the Teensy 4.0 in device mode as currently there are are no library's that support it.
    Confirm, this is correct where "possible" means using existing libraries.

    If "possible" means the hardware could do it if library code were written (or converted from the first port), then it is possible with that sort of programming.


    Thats a real shame and a trick missed .... maybe PJRC can add it as a feature to the Teensy API in the future.
    Yes, this is on my todo list. We even purchased special cables to sell for this, which have been sitting unused in a box.

    But the reality is this is a much lower priority than so many other things, like USB Audio and porting OctoWS2811, plus new hardware. There are only so many hours in every day. We have to prioritize, and indeed support for using both USB ports in device mode is on the list, but not expected to have a nice library anytime soon.

  11. #11
    Junior Member
    Join Date
    Feb 2020
    Posts
    5
    Quote Originally Posted by PaulStoffregen View Post
    support for using both USB ports in device mode is on the list, but not expected to have a nice library anytime soon.

    @PaulStoffregen,

    Many thanks for the clarification ....

    For now we will implement the same hardware/software we used with Teensy 3.2 (FT232RL USB to TTL Serial Adapter Module connected to Teensy I/O).

    Cheers
    Jay

Posting Permissions

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