Skip to content

Hardware control flow (RTS, CTS)

Kaibu edited this page Jan 23, 2020 · 7 revisions

Hardware control flow allows us to use the Erika with maximum speed. Without that, we would need to wait long enough until we can be sure that the Erika is ready to receive the next character.

Raspberry Pi

Moved to RaspberryPI Setup

ALT3 mode

The above approach uses the Device Tree to set the Raspi GPIO Pins 16 and 17 to ALT3 mode, which gives us the RTS/CTS lines.

In case you have a Raspi with a 26-pin header, RTS/CTS are on pins 30 and 31 of the P5 header. For this, you will need uart-ctsrts-p5 instead of uart-ctsrts in the above step-by-step guide.

Current versions of RasPi kernels and firmware like Raspbian use a Device Tree (DT) in order to . More info: Raspberry Pi docs: Device Trees, overlays, and parameters

Discussion: RaspberryPi Forum: How to enable CTS RTS for Raspberry Pi 3 b+ UART

Alternative to the Device Tree approach

  1. use https://github.com/mholling/rpirtscts to set the serial port in the right Mode
  2. enable rtscts and set right speed with stty
    stty -F <device> rtscts
    stty -F <device> speed 1200

These steps have to be repeated after every reboot.

FT232RL

The USB-to-serial adapter FT232RL supports hardware control flow (using the RTS/CTS lines), however, it can take up to three characters after the Erika sends its busy signal until the adapter stops sending data.

If CTS# is logic 1 it is indicating the external device cannot accept more data. the FTxxx will stop transmitting within 0~3 characters, depending on what is in the buffer.

This potential 3 character overrun does occasionally present problems.

source: https://www.ftdichip.com/Support/FAQs.htm

For our case, this is not enough.

Troubleshooting

If it does not work,

  1. double check your tty settings by stty -F <device> -a
  2. Check your solder joints, connections and wiring
  3. Use a voltmeter and/or a logic analyzer

General documentation

RTS/CTS flow control

https://ethertubes.com/raspberry-pi-rts-cts-flow-control/