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

Thread: Teensy 3.6 at high baud rate

  1. #1
    Junior Member
    Join Date
    Sep 2017
    Posts
    2

    Teensy 3.6 at high baud rate

    I need to make a teensy 3.6 serial1 work at 912600 baud, 8n1. Since the max baud rate listed as being possible is 115200, is this even going to be possible?

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,115
    Yes, baud rates up to several megabits/sec work.

    Serial1 and Serial2 have FIFOs which really help interrupt reduce overhead at higher speeds.

  3. #3
    Senior Member
    Join Date
    Dec 2014
    Posts
    217
    Where do you see the max serial rate listed at 115200?
    In general, these serial ports go up to megabits per second; I've used them successfully at 1 Mbps.

  4. #4
    Senior Member MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    2,382
    In addition to using the 2 serial ports with FIFOs (Serial1 and Serial2), if your device supports it, you might want to enable hardware flow control using CTS (pins 18 or 20 for Serial1 and pin 23 for Serial2) on the Teensy connected to the RTS pin of the device, and connecting any digital pin to be used as RTS to your device's CTS pin:


    Also note, if your device is far enough away, it may be useful switching to something like RS-485, which provides check-summing, etc.

  5. #5
    Junior Member
    Join Date
    Sep 2017
    Posts
    2
    I saw the max rate as I was reading the PJRC website. For the serial ports the table read what acceptable baud rates were. So I took that to mean you could not go beyond that.

    Fortunately I was able to write a test program which spit out a buffer of ten 0x55 bytes to the port, then measured the end of the final stop bit with a scope. that's 100 bits in all and it came in at 109.5us, giving a baud rate of 913242. Which is only .07% off. So I'm happy the devices will be able to communicate over 422 with this bitrate.

  6. #6
    Senior Member
    Join Date
    Dec 2014
    Posts
    217
    Whatever table you were looking at is probably not applicable to the Teensy 3 series :-)

    I'm glad that ten bytes came out OK for you, although the correct measurement cycle for asynchronous serial is within each byte -- leading (falling) edge of start bit to leading (rising) edge of stop bit. The reason for this is that a stretched stop bit is totally acceptable on an asynchronous serial interface, and shouldn't count "against" the timing of the interface.

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,115
    I've added another table near the end of this page, showing the newer Teensy boards and higher baud rates.

Posting Permissions

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