1
\$\begingroup\$

As you know Arduino Mega has 4 serial ports. I need one extra serial port besides the one which is connected to computer via usb cable. So I want to use one of the other 3 serial ports. But they are just pins. Is it possible to use any other serial port with usb to connect to PC and if so how can we do that? How can I connect those two RX TX pin to a usb for connecting to computer?

\$\endgroup\$
  • \$\begingroup\$ You probably want a logic-level USB-serial cable, as is commonly used with minimal Arduino circuits that lack an onboard USB interface or RS232 level translator. \$\endgroup\$ – Chris Stratton May 5 '14 at 15:09
  • \$\begingroup\$ Solution should look like somthing like that. If I do so, will my computer see it as it does other one like COM3 or COM4? \$\endgroup\$ – Zgrkpnr May 5 '14 at 15:12
  • \$\begingroup\$ If you have the proper driver installed then yes, that is how a windows operating system would probably present it. \$\endgroup\$ – Chris Stratton May 5 '14 at 15:45
1
\$\begingroup\$

You need an FTDI cable, for example, this one from Sparkfun on each additional serial port you want to use, connected to whatever serial device you want it to talk to.

If the target serial device is the same computer you're developing code on, you'd connect the cable to an additional serial port on that computer. For OS-X, you're done. For Windows, you probably need an FTDI driver for the additional port.

The example cable has a 6-pin female connector. You'd to wire its Rx & Tx pins to your Mega's Rx1 (for instance) and Tx1 pins, and its ground to one of the Mega's ground pins.

\$\endgroup\$
  • \$\begingroup\$ Can I directly connect them to Arduino? The cable you refer does not have any TTL voltage converter so doesn't it harm the Arduino? \$\endgroup\$ – Zgrkpnr May 5 '14 at 16:17
  • \$\begingroup\$ That cable is a USB <-> TTL (5v) Serial cable. The level shifting is already done for you so you can wire directly to the Arduino's UARTs. I tried it with a similar cable on my own ATMega2560. Now that I now how easy it is, I'll be using two serial ports during development from now on, to avoid constantly disonnecting my terminal (and usually forgetting :( to do it) every time I need to upload, so thanks for your question! \$\endgroup\$ – JRobert May 5 '14 at 16:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.