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

Thread: question regarding use of multiple teensy simultaneously

  1. #1

    question regarding use of multiple teensy simultaneously

    hello !
    for my project i decided to use two teensy boards at the same time on one computer.
    what i do is receive lots of fast paced inputs and react accordingly with some actions and some outputs to other devices and also back to the source computer , and it all happen simultaneously . finally i decided to divide the different functions into distinct boards (meaning different teensies could work at the same time and be more efficient ) that act on their own , without transmitting information between them - but connected to the same computer .

    my questions :
    1 . i came across this thread with something called 'tycmd' that looks like what i need , but the terminology confused me and i had to ask , does anyone know if thats the tool i need to make the teensies work at the same time like i described ?

    2. is it a problem to use teensy 3.6 and 3.5 at the same time and same computer ?

    thats all for now , thank you and good day!

  2. #2
    Senior Member
    Join Date
    Apr 2013
    The Tycmd tools allow reprograming a specific Teensy out of multiples on a PC, which may help while you are putting this project together. Once they are programed they should be assigned unique serial port IDs by your OS, at least if your configuration is unchanged (you do not swap any other USB devices around). So your PC will just have multiple serial ports and your PC side code does not need to worry too much about devices until you are plugging in double digits worth of Teensyies on the same machine. If you need things to be more robust then you would setup some form of identify mechanism in the serial data flow, so for example writing '$ID' to the teensy causes it to repley with either the unique mac address or some other ID you define to your PC side code to allow it to match serial ports to functions, or at just produce an error that something has changed and needs attention. Would depend if this is a single purpose setup you will be managing or a project that you will ship for others to use.

    Another option is to use one of the serial/spi/i2C to allow Teensies to pass data between them and have a master Teensy that frames up the data with header information (and possibly a time stamp) and passes it to the PC for processing across a single connection.

    Be aware that internal to your PC all sorts of things will happen to the USB data that will add latency so do not assume that because one teensy on your test machine can stream X bits per second that on some other hardware/OS/software setup two teensies can stream 2*X bits per second. You may find answer is in fact 0.5*X bits due to internal handling of the USB processing.

  3. #3
    ok so i think thats a little over the top
    i understand what you said about tycmd , i might use it when i assemble the apparatus and come across some errors ...
    but in general , just activating 2 teensies on one computer doesn't involve additional preperation ?

    if i go down to the level of actions -
    i plug them with two usb cables to two usb entries on the front of my computer and than just open two windows of arduino ide and set the right details in the tools section and upload ?

  4. #4
    Senior Member
    Join Date
    Jul 2014
    You can add multiple teensies via a hub to a PC.
    Assume they are running serial, then each one will show up as a different com port
    you can connect any terminal program (e.g. Putty) and talk to each teensy independently.

    The Arduino/teensy way to download:
    to download the same program to all Teensies, simply use verify on Arduino (NOT download).
    once the Teensy.exe program shows up (the small program) press the button on first teensy, it will download the program,
    after that, press button on second teensy to download the same program to the second teensy.

    to download different programs to the different teensies,
    again compile both programs with verify and copy the hexfile from temporary work area to a good location.
    with open file on teensy.exe select file to download, and press button on teensy.
    repeat for second teensy

  5. #5
    i tried to do as you say but it didn't work .
    to make sure i understood your instructions , here's what i did :

    beginning - everything is closed/disconnected (arduino program , teensy.exe , teensy ). arduino program manually from programs-> opened ino file #1 -> set it in tools to teensy 3.5 -> verify -> teensy.exe opens automatically -> open hex file -> right click , copy ,paste to good location. arduino program manually from programs-> opened ino file #2 -> set it in tools to teensy 3.6 -> verify -> teensy.exe opens automatically -> open hex file -> right click , copy ,paste to good location.
    3.connect T3.5 -> in teensy.exe , open hex file (from good location) #1 -> click button on T3.5
    4.connect T3.6 -> in teensy.exe , open hex file (from good location) #2 -> click button on T3.6

    after that i have only one monitor open and im not sure if the program runs or not . clearly i didn't understand what you said but im not sure what...?

    please i really need some help to finish this !

  6. #6
    Moderator KurtE's Avatar
    Join Date
    Jan 2014
    Again not sure what exactly you are asking... Also not sure when you say 1 computer if you are talking Windows, MAC or Linux?

    You can use the TyCommander code to talk to multiple Teensy boards connected on the same computer and have them program the specific one you wish to program...

    After you install Arduino and Teensyduino and install TyCommander. Run TyCOmmander and go to the Tools menu and choose the Integrate with Arduino option. In here you browse to your Arduino installation directory (or directories one at a time). And then choose Integrate... Normally I do this without Arduino running... If Arduino is running you will need to restart it after integrating for it to take effect.

    At this point if I am going to program a Teensy or two, I might close TyCommander just to to make sure Arduino will load it... Now load one of your programs, make sure you have the correct processor... And then click the program button in the Arduino IDE, with one or more of your Teensy boards connected. When the program finishes compiling it should load TyCommander and have a dialog come up asking you which of your Teensy boards you wish to program... Choose it and hopefully it will upload the program to that Teensy. Once it knows that you wish for that program to run on that teensy, the next time you do a upload command, it will automatically choose the same Teensy... Repeat steps for other Teensy boards you wish to program...

    To see the data in the Serial monitor of TyCommander click on the Serial tab window to show that devices serial output... Note: you can create new windows and the like, and also I usually change my window to compact view.

    There are other tricks that TyCommander can do as well, like if you have 3 teensy boards that you want all programmed with same program you can use multiple selection to choose those boards in the dialog and have all 3 update with new uploads... There are other ways to get the multiple to work as well, but hopefully this should get you up and programming the multiple boards.

    But as to how to use the multiple ones on your computer, I am assuming that you have some program running on your Computer that will read in the data...

    On Windows you would probably configure your program to know each Teensy by Comm port (assuming Serial communications)...

    On Linux you can do it by /dev/ttyACM0 (where the end 0 will be different number for each Teensy as well as any other ACM devices). In these cases I typically use UDEV rules to create an alias for each of the Teensy boards I wish to talk to, where you can use the Serial# of each specific Teensy to create a specific device name, like: /dev/ttyTeensy1. I use this with Robots to do for example if I have a Teensy that is being used to control Dynamixel servos I create the device name: /dev/ttyDXL which is the first name I look for in my driver code.

    Hope that helps

  7. #7
    I'm having this same? problem. "not compiled for this board" - but yes it is!
    Win7 T3.2 and T3.6. I just cannot work with both at the same time. I have to unplug both, restart Arduino IDE and work with one at a time. It is a real PITA!
    I cannot access the buttons on the teensys as they are in enclosures.
    Are the only three options:
    1. manually opening the hex files in the teensy loader? or
    2. TyCommander (I'm not sure I'm ready to cope with another piece of software..)
    3. Use two computers.
    There must be a simple fix? - or is this a known Arduino IDE bug / feature?
    The problem does look like it is on the Teensy side, but I'll admit I've not tried to work with different AVRs / Arduino native boards.


  8. #8
    TyCommander is a great solution for me and highly recommended. It has a productive and usable UI well worth 'learning' - shows multiple Teensy's when connected and provides easy ways to direct the output to the desired device - put it into bootloader mode or reset it.

    Closing the IDE and Teensy Loader and then in TyCommander choosing 'File / Integrate to Arduino' pointing to the install it will replace the Teensy Loader to allow directed HEX Uploads to specific devices.

    Also it provides a unique SerMon window for each Teensy - on tabs or Ctrl+N for a new window. If the sketches have unique names they associate with a device at your selection. Using the same sketch name requires 'drop association' right click on the last Teensy uploaded before uploading the next from the IDE - or manually clicking and uploading to the specified Teensy the proper HEX.

  9. #9
    Many thanks for the advice, 15mins after downloading TyCommander I was up running both boards and bug-hunting at twice my previous speed.
    I connected one at a time, renamed them to T32_001 and T36_001, Integrated to arduino, and started two instances of the Arduino IDE. Ctrl+N for multiple serial monitors really useful tip!
    Thanks again!


  10. #10
    Glad to hear it works as well for you as I found it to. And the learning curve not what you expected - it just works providing good help especially when doing multiple Teensy's.

Posting Permissions

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