How to control RS232 device with handshaking via USB host shield+Arduino

Hi,

I am trying to control a pump with a RS232 to USB converter cable (National Instruments - USB-232; 188345C/02) connected to a USB host shield that is attached to an Arduino UNO. The pump needs hardware handshaking for flow control, but the Arduino UNO has no DTS/DSR capacity. We know that the RS232 to USB converter cable works on a PC. Shouldn't this also work on an Arduino UNO via USB host shield? Could it be I have to use a specific driver (for the cable), such as FTDI or PL2303 with the Arduino? Any suggestions regarding the how-to?

Thank you

Jae

janusjan:
Hi,

I am trying to control a pump with a RS232 to USB converter cable (National Instruments - USB-232; 188345C/02) connected to a USB host shield that is attached to an Arduino UNO. The pump needs hardware handshaking for flow control, but the Arduino UNO has no DTS/DSR capacity. We know that the RS232 to USB converter cable works on a PC. Shouldn't this also work on an Arduino UNO via USB host shield? Could it be I have to use a specific driver (for the cable), such as FTDI or PL2303 with the Arduino? Any suggestions regarding the how-to?

Thank you

Jae

Wow! talk about A->B->B->A!

why don't you just use as MAX232 and implement the flow control yourself? It is not hard to add the code to the Serial objects. I did it in a couple of days.

Chuck.

Sounds like you have experience with this. Is this something you could help us with?

janusjan:
Sounds like you have experience with this. Is this something you could help us with?

I implemented CTS/RTS handshaking into the HardwareSerial class, is uses GreyGnome's EnableInterrupt library (interrupts on all PCINT pins library).

Send me a schematic of your project, Do you need full RS232 hardware lines (RTS/CTS, DTR/DSR, RI)?

Currently my library modifications just support CTS/RTS. The CTS signal is used as an Input to the Arduino, It causes HardwareSerial to stop sending until it clears. This will block the Arduino application code if the output buffer fills and the receiving device does not clear the CTS line.

I implemented a one second timeout that fails out of the send=Serial.print() function with the actual number of bytes send. The application has to verify the returned value send actually matches what was passed to Serial.print() else a timeout occured.

RTS is set by HardwareSerial when the input buffer fills to 60 bytes, it is cleared when the app uses Serial.read() to empty the buffer.

If you need DTR/DSR on top of CTS/RTS your application would need to control the DTR/DSR lines. If you could substitute CTS/RTS for DTR/DSR then it would be a direct replacement.

Send me your UNO code so that I can see if it is compatible with my custom HardwareSerial Library.

chuck.

Hi all,

Chuck, i found the post since i have similar need as Jae (to connect a positioner i would like to drive via arduino through rs232 requires CTS RTS) and was thinking of using the usb shield + usb to rs232 because in spite of days of research i did not find a mod library like one you mention.

Your answer to him gave me hope.
Would it be possible for you to share it eventually accompanied by a basic sketch (i think i understood the concept from your clear explanation but still i´m very very very newbie to Arduino programming and an example would be very helpful).

Regards

anrtonio

antonio_q:
Hi all,

Chuck, i found the post since i have similar need as Jae (to connect a positioner i would like to drive via arduino through rs232 requires CTS RTS) and was thinking of using the usb shield + usb to rs232 because in spite of days of research i did not find a mod library like one you mention.

Your answer to him gave me hope.
Would it be possible for you to share it eventually accompanied by a basic sketch (i think i understood the concept from your clear explanation but still i´m very very very newbie to Arduino programming and an example would be very helpful).

Regards

anrtonio

antonio,
the Arduion->usb->usb->Serial won't work easily, you would have to write a USB Serial driver for your Arduino.

I will sell you a copy of my modifications if your are interested. private message me if you are interested.

Chuck.