Sharvin
Posts: 17
Joined: Tue Feb 19, 2019 1:19 pm

How to enable CTS RTS for Raspberry Pi 3 b+ UART

Wed May 29, 2019 11:03 am

I have a Raspberry Pi 3 b+ with Raspbian Stretch Lite. I want to enable CTS RTS for UART ttySO.

To achieve this I have followed the following steps:-

1. I have enabled the UART ( Note I have tested the UART and it is working perfectly. ) I have configured UART using this link
https://www.circuits.dk/setup-raspberry-pi-3-gpio-uart/

2. I searched for a document to enable CTS RTS for Raspberry Pi. I am unable to find any relevant source to solve this issue.

Can anyone please share a document or any resource so I can enable CTS RTS on UART ttySO?.

User avatar
joan
Posts: 14351
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: How to enable CTS RTS for Raspberry Pi 3 b+ UART

Wed May 29, 2019 12:21 pm

At the very least you will have to enable the CTS and RTS GPIO. You will then have to connect those GPIO to the external device.

CTS is available on GPIO16.

RTS is available on GPIO17.

For UART 0 (I guess ttyS0) you will have to place those GPIO in mode ALT3. For UART 1 you will have to place those GPIO in mode ALT5.

See page 102 of BCM2835 ARM Peripherals

I don't know if the kernel driver will then automatically handle CTS/RTS. You will have to try.

HiassofT
Posts: 220
Joined: Fri Jun 30, 2017 10:07 pm
Location: Salzburg, Austria
Contact: Website

Re: How to enable CTS RTS for Raspberry Pi 3 b+ UART

Wed May 29, 2019 12:24 pm

You can do this with a small, custom device tree overlay file.

A couple of months ago I faced the same issue and created a bunch of overlays - you can download them from here https://github.com/HiassofT/AtariSIO/tr ... ontrib/rpi

For ttyS0 you need to copy "miniuart-ctsrts.dtbo" to /boot/overlays and then enable it with "dtoverlay=miniuart-ctsrts" in config.txt

so long,

Hias

Sharvin
Posts: 17
Joined: Tue Feb 19, 2019 1:19 pm

Re: How to enable CTS RTS for Raspberry Pi 3 b+ UART

Wed May 29, 2019 2:19 pm

Thanks a lot it worked
HiassofT wrote:
Wed May 29, 2019 12:24 pm
You can do this with a small, custom device tree overlay file.

A couple of months ago I faced the same issue and created a bunch of overlays - you can download them from here https://github.com/HiassofT/AtariSIO/tr ... ontrib/rpi

For ttyS0 you need to copy "miniuart-ctsrts.dtbo" to /boot/overlays and then enable it with "dtoverlay=miniuart-ctsrts" in config.txt

so long,

Hias

shivpatil
Posts: 2
Joined: Tue May 28, 2019 5:54 am
Location: India

Re: How to enable CTS RTS for Raspberry Pi 3 b+ UART

Fri May 31, 2019 1:44 pm

Hello,

I getting the same problem while Communicating with a device using UART Interface using HW Flow Control Enabled.

I have done the following settings
1. Added following lines @end if /boot/config.txt file.
enable_uart=1
dtoverlay=pi3-disable-bt
dtoverlay=miniuart-ctsrts

2. Added "miniuart-ctsrts.dtbo" to /boot/overlays.


I would like to ask that,

I Have to use MAIN UART (PL011) of the Raspberry Pi rather than MINI UART to achive a higher baud rate (1500000) & more stability (as mini uart has some drawbacks like not able to detect breakdown, no receive timer interrupts etc).

For that I have disabled the Bluetooth UART Port.



Out of serial0 & serial1 which one is configured for Bluetooth?

Will this Configurations enables the CTS/RTS Pins for MAIN UART (PL011) ?

If I would also like to enable CTS RTS for that UART what should I do?..

HiassofT
Posts: 220
Joined: Fri Jun 30, 2017 10:07 pm
Location: Salzburg, Austria
Contact: Website

Re: How to enable CTS RTS for Raspberry Pi 3 b+ UART

Sat Jun 01, 2019 9:39 am

For the PL011 (/dev/ttyAMA0) UART use the uart-ctsrts overlay from the github link I posted above.

so long,

Hias

Return to “Interfacing (DSI, CSI, I2C, etc.)”