Serial Communication on Digital Pins 0 and 1

I've written an Arduino sketch that uses the Serial.begin(), Serial.available(), etc functions. When I'm using the serial monitor it works fine. However, when I connect wires to digital pins 0 and 1, which are labeled as serial TX and RX, nothing happens. Does something need to be done to cause serial transfer over these pins vs. the USB connection?

When you say "nothing happens" what are you expecting to happen.

If you sketch is sending serial data you will see it on the output pin if you connect it to a scope or an LED. To get it into the computer you have to be listening on a serial connection through an application like a terminal or Processing or some other language / application.

Pins 0 and 1 are also hard wired to the USB connection.

Please describe your circuit and sketch, and what you expect to see.

-j

Two possible issues here:

  1. Something connected to the USB at the same time as something else is connected to pin 0 + 1. This can cause problems.

  2. The device communicating with Arduino on pin 0 + 1 must have its ground connected to Arduinos ground.

when I connect wires to digital pins 0 and 1, which are labeled as serial TX and RX, nothing happens.

If the wires you are connecting go to some kind of serial device you probably need to convert the TTL serial of the Arduino to standard serial. Do some MAX232 & MAX3232 searches if this is what you're doing.

If the wires you are connecting go to some kind of serial device you probably need to convert the TTL serial of the Arduino to standard serial. Do some MAX232 & MAX3232 searches if this is what you're doing.

I didn't need to do any conversion between my Arduino Mini and the serial inputs of a Lantronix Matchport. I just wired them straight across. (TX -> RX and RX -> TX of course.)

However, I did forget to use a common ground, (I was powering the two devices separately). Once I did that then data started to flow. I also couldn't leave the USB connected, so I would upload my sketch, remove the USB, restart the Arduino and everything worked fine.