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

Thread: Serial port splitting ?

  1. #1
    Senior Member
    Join Date
    Jun 2013
    Location
    Montréal
    Posts
    467

    Serial port splitting ?

    Hello,

    I have a project where I need to control 5 of these boards: https://www.sparkfun.com/products/12781
    They run Arduino and have standard serial ports.
    Would it be possible to use the Serial port of a single Teensy and split the signal into 5 cables ? Do I need additional electronics or should it just work ?

    Thanks !

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,679
    Do you need to send only (from teensy side) ?
    If yes, a way without additional hardware might be to switch to the alternate Pins (pin 5 for TX1, Pin 31 for TX2) between sending the commands.

    Edit: You might want to make sure that the fifo's are empty before switching to the alternate configurations.
    Last edited by Frank B; 01-17-2016 at 08:36 PM.

  3. #3
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828
    Quick glance... looks like JP3 is to mate with an FTDI USB to Serial (5V levels). Needs the DTR signal to cause the AVR to run its bootloader.


    Controlling 5 EL boards with a Teensy...
    The boards don't have addresses. So you can use GPIO pins on the Teensy as software serial. And there are two hardware UARTs on the teensy 3.1.
    Teensy's UARTs and GPIO are 3.3V signals. EL boards want 5V. The Teensy's TX will work. Each Teensy's RX needs a pair of resistors to divide the 5V to 3.3V.

    Teensy doesn't normally have a DTR per UART port but you can simulate that with 5 DTRs from GPIOs. DTR needed only to trigger the bootloader on the EL boards.

    If you don't mind the $, and time to learn, you could use the EL boards' XBee socket. Put an XBee SERIES 1 in each board. There's a daughter card for the Teensy 3 for XBee. And a lib.
    Now the one XBee on the Teensy can address which Teensy it wishes to send to.

  4. #4
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,679
    Quote Originally Posted by stevech View Post
    And there are two hardware UARTs on the teensy 3.1.
    Correction: three hardware UARTs

  5. #5
    Senior Member
    Join Date
    Jun 2013
    Location
    Montréal
    Posts
    467
    Thanks for the answers.
    Just to clarify I don't need to receive data from the EL Sequencer boards, just send it from the Teensy.
    I don't mind sending the exact same data to each board as I'll be sending MIDI and will use different MIDI channels for each board.
    So HardwareSerial + SoftwareSerial + level shifting to 5V could do the job.

  6. #6
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,679
    Hm.
    If all boards get the same data, you could go with a single serial port...

  7. #7
    Senior Member
    Join Date
    Jun 2013
    Location
    Montréal
    Posts
    467
    Thanks I'll try that first !

  8. #8
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,301
    Years ago I worked on a project using 14 of those El Wire boards (the old version) and a LOT of El Wire. Here's a blog article I wrote at the time. El Wire doesn't photograph really well, but it was really awesome at night.

    http://dorkbotpdx.org/blog/paul/hand...oat_wins_award

    That project was controlled by a laptop. A single Teensy acted pretty much as only a USB-serial converter which transmitted the same serial data to all 14 boards. Each board listened for its own data, configured by jumpers on the extra I/O pins. The source code is on that page.

    Sparkfun actually redesigned the product, based on this article I wrote about the many problems we faced. Their new board has optocouplers, so it should be much better.

    http://dorkbotpdx.org/blog/paul/spar...uencer_trouble

  9. #9
    Senior Member adrian's Avatar
    Join Date
    Oct 2015
    Location
    Wellington, NZ
    Posts
    504
    PaulStofreggen that is a cool float.

    nlecaude, if you have each of your 5 boards set up to 'respond' to a different midi channel, then you would send all the data to each one, right? ... board 2 only 'responds' to data on channel 2, even though its got the whole kaboodle .... so the issue is ...

    "Can the single serial port u are sending data out of on the teensy drive 5 parallel rx tx wires such that each board gets a strong enough signal at their serial ports?"

    I suppose there is a more 'targetted' way to do it, maybe splitting your midi stream into three, ch1 and 2 on serial 1, ch3 and 4 on serial 2 etc, so that the receiving boards don't get the whole kaboodle .... but does that matter? Maybe their serial ports and processors are efficient enough at the rates you are using to transmit that there is nothing to be gained in splitting up the midi stream?

  10. #10
    Senior Member
    Join Date
    Jun 2013
    Location
    Montréal
    Posts
    467
    Hello,
    Just wanted to mention that the project went very well. To make sure I wouldn't have too much voltage drop I used an RS232 convertor: https://www.sparkfun.com/products/11189
    I had one master teensy connected to 5 EL Sequencer boards. The communication was done using MIDI so I assigned a different MIDI channel for each El Sequencer. Worked like a charm !
    Thanks for the tips !

Posting Permissions

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