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

Thread: Hardware flow control in Teensy 3.6

  1. #1
    Junior Member
    Join Date
    Apr 2019
    Posts
    6

    Hardware flow control in Teensy 3.6

    I'm going to implement hardware flow control from my Teensy 3.6 to my Bluetooth module (nRF52840). I'm wondering how does the Teensy harware flow control work. Do I need to program the RTS/CTS pins to work when I want them to? Or can I simply enable them as RTS/CTS pins and they should work assuming the nRF has HWFC enabled as well? Or is there some kind of library I should implement to get this to work?

    Thanks!

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,929
    Quote Originally Posted by Marius19992 View Post
    Or can I simply enable them as RTS/CTS pins and they should work assuming the nRF has HWFC enabled as well?
    This. Just use attachRts(pin) and attachCts(pin), as documented here:

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

    CTS is only supported on certain pins, as also documented on that page.

  3. #3
    Junior Member
    Join Date
    Apr 2019
    Posts
    6
    Quote Originally Posted by PaulStoffregen View Post
    This. Just use attachRts(pin) and attachCts(pin), as documented here:

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

    CTS is only supported on certain pins, as also documented on that page.
    Thank you. I'm also using stop bytes "\n\r". I'm wondering, am I able to use the HWFC to set start and stop recieve instead of having start and stop bytes or are these necesarry as well?

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,929
    Quote Originally Posted by Marius19992 View Post
    am I able to use the HWFC to set start and stop recieve instead of having start and stop bytes or are these necesarry as well?
    What is or isn't necessary for your application is a much larger question.

    I can tell you, when Teensy's CTS input is driven to logic high, Teensy will not transmit more bytes until it goes low. Likewise, Teensy will drive the RTS output depending on the buffer watermark levels, which you can find in the serial1.c code if you're curious to dig deeper into how it really works.

    But whether that gives you everything necessary for your particular application, I do not know and can not answer.

  5. #5
    Junior Member
    Join Date
    Apr 2019
    Posts
    6
    Quote Originally Posted by PaulStoffregen View Post
    What is or isn't necessary for your application is a much larger question.

    I can tell you, when Teensy's CTS input is driven to logic high, Teensy will not transmit more bytes until it goes low. Likewise, Teensy will drive the RTS output depending on the buffer watermark levels, which you can find in the serial1.c code if you're curious to dig deeper into how it really works.

    But whether that gives you everything necessary for your particular application, I do not know and can not answer.
    My question was a badly formulated, sorry. Thanks for your answer, it cleared up my understanding.

Posting Permissions

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