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

Thread: More than one USB Serial possible

  1. #1
    Junior Member
    Join Date
    May 2020
    Posts
    8

    More than one USB Serial possible

    Hi,

    is it possible to have more than one USB-Serial?

    I would use one for logging/control and one for an application interface. But i did not find anything about.

    At the "old" lib it looks like that this is possible.

    st0ne

  2. #2
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    5,105
    What Teensy are talking about?

    I know on the Teensy 4.0 and the T4.1 support was added for Triple Serial through the usb connection to the PC:
    Code:
    Serial
    SerialUSB1
    SerialUSB2
    You use SerialUSB1 or SerialUSB2 like you would use a normal Serial command

  3. #3
    Junior Member
    Join Date
    May 2020
    Posts
    8
    thanks, i will try it.
    I have an Teensy 3.2. But for USB endpoints i think the hardware should not be relevant.

    So SerialUSB2.begin() should work? Or is there something to include?

  4. #4
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    5,105
    A couple of things.
    1. Make sure you select Triple Serial on the dropdown menu for the USB Type
    2. if you use SerialUSB2.begin make sure you include the baud SerialUSB2begin(115200). Technically you don't even need the begin. Teensies default to make usb speed.

  5. #5
    Junior Member
    Join Date
    May 2020
    Posts
    8
    hm, there is no SerialUSB1 or SerialUSB2. Should this work on Teensy 3.2? Also it shows no "Tripple USB" or similar in the usb type menu

  6. #6
    Senior Member
    Join Date
    Aug 2017
    Posts
    250
    Quote Originally Posted by st0ne View Post
    hm, there is no SerialUSB1 or SerialUSB2. Should this work on Teensy 3.2? Also it shows no "Tripple USB" or similar in the usb type menu
    What versions of Arduino and Teensyduino are you using? There is is no 'Tripple USB' in the 'USB Type' part of the Tools menu. I think @mjs513 was referring to 'Triple Serial' in the 'USB Type' part of the Tools menu.

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,825
    Quote Originally Posted by st0ne View Post
    Should this work on Teensy 3.2? Also it shows no "Tripple USB" or similar in the usb type menu
    Yes, it also works on Teensy 3.2. But you need to install Teensyduino 1.52, because this feature did not exist in 1.51 and earlier.

    https://www.pjrc.com/teensy/td_download.html

    In Arduino, click Help > About (or Arduino > About or Teensyduino > About if you have a Mac) to check which version you have installed.

  8. #8
    Junior Member
    Join Date
    May 2020
    Posts
    8
    Quote Originally Posted by PaulStoffregen View Post
    Yes, it also works on Teensy 3.2. But you need to install Teensyduino 1.52, because this feature did not exist in 1.51 and earlier.

    https://www.pjrc.com/teensy/td_download.html

    In Arduino, click Help > About (or Arduino > About or Teensyduino > About if you have a Mac) to check which version you have installed.
    aah, maybe thats the problem, i will try with 1.52

    many thanks!

  9. #9
    Junior Member
    Join Date
    May 2020
    Posts
    8
    looks like it works. thanks :-)

    is it also possible to get signals like CTS or RI back to the PC via USB?

  10. #10
    Junior Member
    Join Date
    May 2020
    Posts
    8
    'SerialUSB2' was not declared in this scope

    hm. did not compile before. only syntax highlighting tested with 1.52...
    have i to include something?

  11. #11
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    6,632
    Did you select in the USB type either Dual or Triple Serial?

  12. #12
    Junior Member
    Join Date
    May 2020
    Posts
    8
    yes i tried that. Did not work. But i also need audio, so i selected "All of the Above"

  13. #13
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,825
    Quote Originally Posted by st0ne View Post
    yes i tried that. Did not work.
    Pretty sure you didn't select Triple Serial (which is the *only* way that works). I tried it here as a quick sanity check. It definitely does work. Here's a screenshot where you can see clicking Verify does correctly compile the code for Teensy 3.2.

    Click image for larger version. 

Name:	sc.png 
Views:	2 
Size:	32.8 KB 
ID:	20295

    But i also need audio, so i selected "All of the Above"
    The "All of the Above" option does not actually include dual or triple serial (and probably never will - as the USB protocol doesn't have enough endpoint to add those to such a long list). "All of the Above" also has several issues, so I'm probably going to remove it for Teensyduino 1.53.

    To get audio and triple serial, you're going to need to edit usb_desc.h. While there are some comments in the code, that requires more skill and attention to detail than normal Arduino coding.

  14. #14
    Junior Member
    Join Date
    May 2020
    Posts
    8
    ok that makes sense that it wont work... i tested your example. it works.

    i looked at the file, looks not really complicated if the code behind will work with different defines than the predefined ones...
    is it possible to select in the menu "no USB" and set the defines for USB in the arduino sketch? So i do not have to edit usb_desc.h.
    But i think the compiler will not use the defines, right?

    if it will work, i can also make a pull request for my changes if needed.

    one of my other questions... is it possible to get DSR or CTS signalling via usb-serial to the pc?

Posting Permissions

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