11 years, 4 months ago.

RS232 interface: how to use CTS/RTS lines?

Hello, people!

I'm designing a hardware containing the mbed and the WIZ610wi wireless module, and I want to connect those using a RS232 interface. But the wireless module requires a 5-wire connection, with the RTS and CTS lines, and I could not figure out how use these connections with mbed UART.

Can anybody show me a way to configure a serial port in mbed that includes RTS/CTS? Would it be fatal for the aforementioned purposes to ignore these lines in my design?

Thanks in advance!

1 Answer

11 years, 4 months ago.

According to this: http://www.saelig.com/supplier/wiznet/WIZ610WI%20User%20Manual_Eng%20V1.7.pdf you can set flowcontrol to none, xon/xoff or rts/cts. So the easiest thing is to use NONE. If you do need flowcontrol you can still use XON/XOFF but note that this is 'in-band' signalling so it works only for ascii and not for binary (unless escaped). Otherwise you can implement RTS/CTS yourself using GPIO pins and RS232 level converters. RTS is an output that must be connected to the CTS input of the WIZ, CTS is an input that must be connected to the RTS output of the WIZ. Now, if you are ready to receive, i.e. you have space in your buffer you assert RTS (Request to Send, AKA Ready to Receive). The WIZ will then send data until your buffer is almost full and you deassert RTS. Similarly you should poll CTS (Clear to Send) and stop sending data to the WIZ when it is deasserted. Note that the RS232 level converters must only be used when you connect via the 9-pin Dsub connector, the signals on the headers are TTL.

Accepted Answer

Thanks a lot for the answer, man!

So I just leave CTS and RTS unconnected at the WIZ610wi and set flow control to none, right?

posted by Diego Ferreira 08 Jul 2013

You may want to just connect the WIZ CTS to its RTS. That will effectively disable the flowcontrol. It should work as long as mbed can keep up with the datarate coming from the WIZ and as long as mbed does not send data faster than WIZ can handle it.

posted by Wim Huiskamp 08 Jul 2013