9 years, 11 months ago.

Hardware handshake of port UART1

I am a little confused with the pinout of mbed pin P0_1722, the official pinout and a user-generated pinout seem different on those pins: https://mbed.org/platforms/mbed-LPC1768/#schematics-and-data-sheets https://mbed.org/users/synvox/notebook/lpc1768-pinout-with-labelled-mbed-pins/

According to datasheet, P0_1722 are associated with UART1, as CTS DCD, DTR, RTS, while official Pinout doesn't label those pins this way.

Essentially my question is, is hardware hand shake implemented on mbed? Or I will need to implement hand share in software?

Another related question is, if I don't use DCD, DSR, RI, DTR pins of UART port 1, can I configure for other use while using UART1. I assume I can, but want to make it sure.

Thanks a lot in advance.

ZL

1 Answer

9 years, 11 months ago.

Hardware Flow Control has been implemented with RTC/CTS, see - SerialBase::set_flow_control(Flow type, PinName flow1, PinName flow2). If not used you can use those pins for the other functions as defined in the datasheet.

Accepted Answer

Hi Pramod Joglekar,

Thanks for answering my question. Could you provide some reference to SerialBase? I couldn't find it underneath Serial class. A simply search for SerialBase in mbed.org also didn't give me many hits.

Per the following discussion, RTS/CTS can be enabled by accessing registers: http://mbed.org/forum/mbed/topic/1306/

Edit: I found SerialBase in source library.

posted by Zhiyong Li 18 May 2014

Expand mbed -> Classes -> SerialBase

posted by Pramod Joglekar 19 May 2014

Probably a silly question: how exactly do I call that set_flow_control function?

I tried the following:

Serial Modem (P0_15, P0_16); This is the port on LPC1768/Mbed that supports hardware handshaking

Modem.set_flow_control(RTSCTS, P0_22, P0_17);

I got the following error message: Error: Class "mbed::Serial" has no member "set_flow_control" in "main.cpp"

According to another thread regarding hardware handshaking, this could be caused by no hardware support. But I am quite sure this particular port on LPC1768 does support handshaking. So I am a bit lost.

posted by Zhiyong Li 26 Aug 2014

Modem.set_flow_control ( SerialBase::RTSCTS, P2_7, P2_2); is what you need

posted by Pramod Joglekar 27 Aug 2014