Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
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.