How to implement CTS and RTS?

Hi at all! How can I implement CTS and RTS pins on Arduino? Can I make them work as ordinary pins? Or I have to buy another Arduino with integrated flow control?


Hi! Excuse me for being a douche, but can you show me a small snippet of code to do it?
Thanks in advance!

What do you want them to do? Typically, RTS is an output and CTS is an input, so you'd have

digitalWrite(RTSPin, HIGH);  // Indicate we have data to transmit
while (digitalRead(CTSPin) != HIGH)
   ;  //block waiting for other side.
Serial.print(mystuff);  // Send the data.
Serial.flush(); // wait for transmit to finish.
digitalWrite(RTSPin, LOW);

Ie - you do everything manually. Neither the hardware nor the Serial implementation in the core with do anything "automatic" with RTS/CTS. (The above example sort-of aims at implementing RTS/CTS handshaking as defined for modem control in the original rs232 spec. That's NOT what is generally used now. If you want "hardware flow control", you'll have to at least modify the "Serial" code.) (Also, polarity may be backward from what is needed, depending on what (if any) hardware drivers are present.)