1

I am working on Raspberry Pi 3 B+ module with raspbian stretch lite os.

I Wants to configure UART interface on Raspberry Pi 3.

I have referred the following link & I am able to test UART Communication successfully.

https://www.circuits.dk/setup-raspberry-pi-3-gpio-uart/

I have to use MAIN UART (PL011) of the Raspberry Pi rather than MINI UART to achieve a higher baud rate (1500000) & more stability (as mini uart has some drawbacks like not able to detect breakdown, no receive timer interrupts etc). Also wants to enable HW Flow Control For UART(PL011).

I have refer the following link & done the following settings

https://github.com/HiassofT/AtariSIO/tree/master/contrib/rpi

  1. Added following lines @end if /boot/config.txt file.

    enable_uart=1

    dtoverlay=pi3-disable-bt // disable Bluetooth to use its UART Port

    dtoverlay=miniuart-ctsrts

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

see the section 2.2 om page no 10 of following link pdf.

https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals.pdf

I need a solution on following questions...

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 MAIN UART (PL011) what should I do?..

  • Well, Rpi UART does not have hardware DTR/RTS pin on the 40 pin connector. So you can only do software flow control. A get around is to use USB/TTL adapter/cable which has the hardware DTR/RTS pins - CTS DTR USB Adapter Pro Mini USB Download Cable to RS232 TTL Serial Ports CH340 Replace FT232 CP2102 PL2303 UART for Arduino fr.aliexpress.com/item/… – tlfong01 May 29 at 11:55
  • And are you sure if you really need to do hardware flow control? In my PC/Arduino days I usually fool the modem by shorting together RTS and CTS. – tlfong01 May 29 at 12:39
2

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.

Also see https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=241623#p1473905 which shows a method to set the modes using device tree.

  • I have tried it, I have connect the CTS (GPIO16) & RTS (GPIO17) Pins to my external device. & have enabled the flow control on both sides. Before this I am using the Beaglebone Black Board & I have tested my code successfully. Now I wants replace beagle bone with Raspberry Pi. I have to use same configurations as on Beagle bone. As per my knowledge we have to add a entry to a /boot/config.txt to enable the all peripherals at the time of boot. How we are going to be sure that Flow control Pins are enable for UART or not? – shiv patil May 29 at 13:07
  • See another answer on raspberrypi.org/forums/viewtopic.php?f=44&t=241623#p1473905 which shows how to use device tree. – joan May 29 at 13:11
  • I have edited my question. Please have a overview on it. – shiv patil May 31 at 14:16
  • @shivpatil No, that is a significantly different series of questions. I answered the original question. If you want to ask another question you should have left this question alone and asked a new (single) question. – joan May 31 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.