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

Thread: Teensy 3.2 Serial comms at 1.5Mbps

  1. #1
    Junior Member
    Join Date
    Mar 2017
    Posts
    9

    Teensy 3.2 Serial comms at 1.5Mbps

    Hi All,

    I want to intercept an RS422 comm at 1.5Mbps, and decode it on the Teensy. In the process of working out how to convert to TTL serial, but I understand that.

    What I'm not sure about is the 1.5Mbps.. is that too fast for Teensy 3.2?

    Would that be a Baud of 150000?

    Thanks,

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,027

    Cool

    I think others have gotten 4mpbs using Serial1 (pins 0/1), and enabling CTS (clear to send) and RTS (request to send). Note, CTS must be pin 18/A4 or 20/A6 for Serial1.

    CTS/RTS are hardware flow control where the receiving hardware can say whether it is ready to receive data. I seem to recall that the library only provides CTS/RTS on Serial1, and not on Serial2 or Serial3, but perhaps that has been fixed:


    Serial1 and Serial2 both have hardware FIFO buffers, which also helps when receiving data.

  3. #3
    Senior Member
    Join Date
    Apr 2016
    Location
    St. Petersburg, FL
    Posts
    210
    I've tested two T32s tied together directly using Serial1 and was able to get 4.5Mbps without using CTS/RTS. However, the 32 byte packets were sent where each T32 had nothing else to do but this particular task. When they were put into the system, remote controlled phased array sonar boat, the rate had to be dropped to 2.25Mbps and still not using CTS/RTS. The first link is from the shore station unit to the laptop. There is another link in the boat connecting the controller T32 with two others collecting echo data. Previous handshake tests failed because the wrong pin was used for CTS, recently discovered.

    I would recommend using the handshake method then push it to the reliable limit.

  4. #4
    Senior Member
    Join Date
    Jan 2013
    Posts
    843
    Teensy 3.2 running at 96Mhz can handle 6MBit without flow control, as long as you process the incoming data fast enough.

    Serial1 and Serial2 have 8-byte hardware FIFOs. An interrupt is triggered when they are half full. The interrupt handler transfers the data into a RAM buffer that's 64 bytes by default (can easily be increased). As long as there is no mis-behaved code that disables interrupts for a long time, there is no issue with FIFO overflow.

  5. #5
    Junior Member
    Join Date
    Mar 2017
    Posts
    9
    Quote Originally Posted by tni View Post
    Teensy 3.2 running at 96Mhz can handle 6MBit without flow control, as long as you process the incoming data fast enough.

    Serial1 and Serial2 have 8-byte hardware FIFOs. An interrupt is triggered when they are half full. The interrupt handler transfers the data into a RAM buffer that's 64 bytes by default (can easily be increased). As long as there is no mis-behaved code that disables interrupts for a long time, there is no issue with FIFO overflow.

    Thanks for the responses everyone, looks like I'll be OK in terms of Data rate, If I could bring up another topic of discussion:

    I'm trying to find a module to convert to TTL serial.

    Sparkfun have this RS485 breakout:
    https://www.sparkfun.com/products/10124

    This board has an SP3485 rs422/rs485 transceiver. But the module is wired for RS-485? RTS is connected to both lines, instead of having the two differential pairs of RS422 that I want to connect. Can I get this to work for me?
    I only need to receive data to teensy.

    I'm having difficulty finding an RS422 module with the 4 terminals, that isn't going take a month to get to me (Montreal).

    Thanks again,

  6. #6
    Senior Member
    Join Date
    Jan 2013
    Posts
    843
    That SP3485 is perfectly adequate. Just wire up your RS422 to A / B and enable the receiver.

    If you wanted to transmit data, you could just use 2 of them, one as transmitter and one as receiver.

  7. #7
    Junior Member
    Join Date
    Mar 2017
    Posts
    9
    Quote Originally Posted by tni View Post
    That SP3485 is perfectly adequate. Just wire up your RS422 to A / B and enable the receiver.

    If you wanted to transmit data, you could just use 2 of them, one as transmitter and one as receiver.
    Thanks tni, that makes sense

Posting Permissions

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