1

I am writing a software that runs on the PC that has a Arduino 2560 connected to it via USB. This PC needs to communicate with multiple devices through RS232.

Is it possible to use the Arduino's 4 UARTs to communicate with 4 different hardware that uses RS232 serial communication, using just 1 USB connection between the PC and the Arduino 2560?

The Arduino 2560 will basically act as an interface for 1 USB to talk to 4 RS232 devices.

asked Aug 7, 2016 at 22:14
3
  • Technically USB device can be composite device, say with 4 USB-CDC (or VCP - virtual comport) devices. Arduino Mega has no native USB, but it is possible to use V-USB library that emulates USB 1.1 device at physical layer using just 2 pins (hardware UART will not be used). But there are some issues: 1) it seems for 1 VCP device 3 endpoints are needed and V-USB can't provide that many, so likely library modification will be needed; 2) for Windows driver - not sure if it is possible to use standard VCP drivers for a such composite device Commented Aug 8, 2016 at 17:34
  • @Flanker Looks like it will be easier to use a USB to four channel RS232 module and connect Arduino to one of the four RS232 channels. Commented Aug 8, 2016 at 20:06
  • You might look at the FT4232H, though who knows what that will be like software wise. Commented Oct 7, 2016 at 4:15

2 Answers 2

1

No, but it is possible to use 3 of them. The reason being that one of them is the connection to the computer.

The hard part is in the programming. You will need not only a suitable sketch on the Arduino (the easy part), but also some software on your computer that presents three COM ports to the operating system and forwards the data through to the Arduino in a suitably packeted format, and receive data back and sent it on to the right COM port. Depending on your operating system that may be a very easy task (on Linux and OS X) or a complete and utter nightmare (Windows).

answered Aug 7, 2016 at 23:00
1

In Arduino terms:

Serial will be committed to receiving data from the PC.

Connecting Serial1, Serial2, and Serial3 via RS232 will be easy.

Adding a 4th Software Serial (or NewSoft Serial or AltSoft Serial) via RS232 will also be straightforward. If you need high speeds for the 4th port, than a UART with SPI (or I2C) interface to the Mega might be a better idea.

The only tricky part is putting in some info in the data from the PC so the Mega can re-send it to the correct port.

answered Mar 7, 2018 at 14:37
1
  • Dang it, I need to remember to look at the dates of posts! Commented Mar 7, 2018 at 14:38

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.