wb0gaz
Posts: 7
Joined: Thu Sep 20, 2012 2:40 am

Serial port flow control - need CTS

Thu Sep 20, 2012 2:45 am

I need to supply CTS signal (as in hardware flow control, ioctl function "CRTSCTS") from my external device to raspberry pi board to enable/inhibit output of async characters on the serial port (my device cannot always accept incoming async character; on other PC using Linux I use crtscts flow control and it works fine, but I am not sure if/how this is enabled in raspberry pi). Is this supported (perhaps using one of the GPIO pins for this purpose?) I cannot use XON/XOFF flow control.

Thank you very much for any pointers

User avatar
TonyD
Posts: 451
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK
Contact: Website

Re: Serial port flow control - need CTS

Thu Sep 20, 2012 7:36 pm

Yes, its a shame CTS never got brought out to the expansion header, especially since RTS is :-(

There was a post some time ago which discussed this problem, it was suggested you could (re)write a serial driver to allow any GPIO to be used for CTS (and RTS)
Tony

wb0gaz
Posts: 7
Joined: Thu Sep 20, 2012 2:40 am

Re: Serial port flow control - need CTS

Thu Sep 20, 2012 8:10 pm

I pretty much expected this (CTS not exposed) but thought I might have overlooked something.

Follow-up question --- would implementing CTS by altering the existing driver (that is, having it suspend output by simply inspecting a chosen GPIO line) be feasible from a hardware perspective (that is, does the UART in the CPU lend itself to implementing CTS this way?)

Thank you for the initial reply - perhaps someone with understanding of this part of the CPU and driver code would be able to comment further per above?

HarryB
Posts: 2
Joined: Sat Sep 22, 2012 10:39 am

Re: Serial port flow control - need CTS

Sat Sep 22, 2012 10:49 am

I was examining the details of the revision 2 modifications this morning. There is now a secondary GPIO header (P5) with pins GPIO28-31 brought out. These pins were previously used for the configuration links on the issue 1 board. Pin GPIO30 can be programmed to be CTS0 and GPIO31 can be programmed to be RTS0, via alternative function 3. I hopefully shall be experimenting with these facilities myself as soon as I receive a revision 2 board.

wb0gaz
Posts: 7
Joined: Thu Sep 20, 2012 2:40 am

Re: Serial port flow control - need CTS

Sat Sep 22, 2012 1:05 pm

Thank you, Harry - I looked at the layout plan for P5 on the 2.0 boards, and that would work well for my application. I gather this (CTS0/RTS0) would be used with the existing serial port found on P1, rather than as part of a different serial port (I've read about "PL011", I think it's called, which is described as on the SOC but not brought out to any connector?

If you would be able to post back to this thread the result of your experiment, that would be very helpful.

User avatar
JimDod
Posts: 22
Joined: Wed Apr 04, 2012 10:24 pm
Location: Southern California
Contact: Website

Re: Serial port flow control - need CTS

Sun Dec 09, 2012 2:41 am

Interesting old thread, any news on this?

wb0gaz
Posts: 7
Joined: Thu Sep 20, 2012 2:40 am

Re: Serial port flow control - need CTS

Sun Dec 09, 2012 2:38 pm

Thanks for looking - the need remains unfulfilled at this point.

I'm in need of CTS flow control on Raspberry PI native async serial port (ideally, using Debian linux) - a signal that the attached device can generate (output), and be received by the Raspberry PI serial port (input), indicating that the attached device's async input buffer is filling/full (it has VERY limited RAM memory - less than 100 bytes for input buffering), so that the raspberry pi stops sending bytes.

I still only have the original (early-mid 2012) version of the board (without the additional header pin positions) but would be able to change to the newer board if CTS were available or could be configured. Unfortunately, I can't use a GPIO pin and manually create a CTS-like signal (driven by my application's incoming data handling), so I need something controlled at the OS driver level.

billvance
Posts: 12
Joined: Mon Jan 20, 2014 5:05 pm

Re: Serial port flow control - need CTS

Sun Feb 01, 2015 8:42 am

Seems to me that there are a large number if USARTS, (Universal Synchronous-Asynchronous Receiver-Transmitter), chips out there that could be used for this.
The main questions are which, and how. This would bypass most of the hassles, of trying to re-engineer an existant partial solution. There are an adiquate number of programmable pins for a number of different solutions. Simplest of all might be a USB to Serial adapter.

Bill

Fat D
Posts: 32
Joined: Wed Feb 12, 2014 4:22 pm

Re: Serial port flow control - need CTS

Sun Feb 01, 2015 10:14 am

This topic went on back in 2012. These days, almost all Pi boards are either Rev2 or Plus, both of which break out CTS. And the initial project probably found a solution already or was given up.

wb0gaz
Posts: 7
Joined: Thu Sep 20, 2012 2:40 am

Re: Serial port flow control - need CTS

Sun Feb 01, 2015 3:26 pm

Thanks very much - I still have the original board (256K memory, ca. 2012 from newark/element14) but didn't further pursue the application I had in mind at the time. When this comes up again, I'll replace that with a current rev board.

billvance
Posts: 12
Joined: Mon Jan 20, 2014 5:05 pm

Re: Serial port flow control - need CTS

Sat Mar 07, 2015 4:32 am

Fat D wrote:This topic went on back in 2012. These days, almost all Pi boards are either Rev2 or Plus, both of which break out CTS. And the initial project probably found a solution already or was given up.
Great! Is there any hard/software you can point to that deals with this? How-to's and what not?

Bill

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