Arduino as USB to Serial problems

Hello,

I'm trying to use a Arduino UNO as USB to serial converter in the following basic setup:
USB connects to the converter Arduino, which connects via the tx/rx pins to another Arduino.

The first arduino is powered obviously by the USB cable but the second is powered by a external 12v power supply. Connections are TX->TX, RX->RX and GND-GND. I have removed the Atmega in the first Arduino to stop it from interfering with the IO pins. However for some reason I am able to receive data from the second Arduino but not send data to it, the second one will not recognize anything.

I've tried the other way around and with different Arduino's but all give the same result. I've also tried not removing the Atmega but shorting the GND and RST pins which also yields the same results.

Am I doing something wrong or is it simply not possible to do this? Thanks!

Connect Tx to Rx and Rx to Tx. Think about what's happening.

...R

Forgot to mention that, also tried it but then I do not receive anything as well.

Draw a diagram showing exactly how you have everything connected and post a photo of the drawing and also post the program that you are using on the second Arduino - I don’t think you have said what type it is.

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

…R

"Connections are TX->TX, RX->RX and GND-GND."

For what you are trying to do (pass-thru) I think that is correct. RX is to the USB chip TX and TX is to the USB RX.

As far as the chip on the first Arduino, program it to ignore Serial. Don't use Serial.begin and don't read or write to Serial.
But be sure to program the second Arduino with begin, read and write.

What baud rates have you tried? Have you checked continuity of your wiring?

Could the USB chip on the second Arduino be taking current away from transmitting?
Have you tried this with a Mini, Pro-Mini or AVR chip on breadboard that has no USB chip?

GoForSmoke:
"Connections are TX->TX, RX->RX and GND-GND."

For what you are trying to do (pass-thru) I think that is correct. RX is to the USB chip TX and TX is to the USB RX.

I think you are right. I was thinking of my USB-TTL cable as equivalent - but it is equivalent to the 16U2 on the Uno board rather than the Atmega 328 connections.

But the OP should still provide a wiring diagram and program code.

...R

That's where I'd look next.

Can't think of anything else but I did have a flaky GF who would check on the position of the planet Mercury in some ass-tro-illogical house or other.

I've attached a diagram of the setup, as far as code goes, the first Arduino does not run a sketch as the Atmega is removed. the second one runs this sketch at the moment:

void setup() {
  Serial.begin(9600);
  Serial.println("Goodnight moon!");
}

void loop() {
  if (Serial.available()) {
    Serial.read();
    Serial.println("hello");
  }
}

GoForSmoke:
What baud rates have you tried? Have you checked continuity of your wiring?

From 9600 all the way up to 115200 and yes, switched the wires all up and still the same, receiving data but not able to send it.

GoForSmoke:
Could the USB chip on the second Arduino be taking current away from transmitting?

This could be possible however I have no clue how to properly test this, I connected the second Arduino also to USB power instead of 12V and got the same results again.

Some more thought on this:
I tested out the Arduino 2 on USB Serial (without Arduino 1 connected) this gives back the expected lots of "hello"'s when sending something to it. However when connecting Arduino 1, Arduino 2 is not receiving from it's own USB serial as well but the USB Serial is receiving data ("Goodnight moon!") from it. (Serial behaviour from COM5(Arduino 2) and COM6(Arduino 1) is identical).
Also when physically looking at both devices, when Arduino 2 is sending data the TX LED on both boards light up. When the first Arduino (The PC basically) is sending data only the its RX LED lights up.

Connecting a USB-TTL cable and Arduino1 to Tx and Rx of Arduino2 will cause a conflict because the USB-TTL on Arduino1 and your USB-TTL cable will both be pulling their Tx lines HIGH when idle. They will both be able to listen but neither will be able to talk.

I wonder is the problem being caused by the 16U2 MCU (which is used for USB-TTL) on Arduino2? Though why the behaviour should be different with Arduino1 on its own compared to the USB-TTL cable on it own I don't know

Create a SoftwareSerial port on Arduino2 (9600 baud) and see if Arduino1 can communicate with that.

...R

16U2 TX connects to Arduino RX and is supposed to be idle-HIGH.

GoForSmoke:
16U2 TX connects to Arduino RX and is supposed to be idle-HIGH.

I think you were too quick for me.

...R

OP, you could program the 328P on an Uno then lift it out and run it on a breadboard.

This link will show you what you need to populate the breadboard, you will need a resonator or crystal and 2 caps.
http://gammon.com.au/breadboard

If you have no resonator or crystal, that blog shows how to bootload and program a 328P on breadboard with an Uno for the breadboard chip to run 8MHz on the internal oscillator.

I'm a bit concerned that the fritzing shows 12V going to Arduino 2 VIN. Is that because fritzing sucks or did you.....?

So i guess the end result is that it's just not possible in this setup?
I setup a software serial on Arduino 2 and it worked to a certain level, it did receive data this time around however it was all corrupted and gibberish came back (the begin message in the setup was received correctly).

GoForSmoke:
I'm a bit concerned that the fritzing shows 12V going to Arduino 2 VIN. Is that because fritzing sucks or did you.....?

Yes I did. It works as long as you are carefull and don't touch other pins with it :o

I am currently switching my program to I2C as this has similar max speeds (400kHz for I2C and 800kHz for Serial from what I've read) and this seems to work fine for my purpose.

Thanks for the quick replies!

Cur410r:
I setup a software serial on Arduino 2 and it worked to a certain level, it did receive data this time around however it was all corrupted and gibberish came back

It should work properly.

...R

Cur410r:
So i guess the end result is that it's just not possible in this setup?

Until you find out why.

So sometimes when debugging and out of clues you make more by changing one thing at a time or removing suspect elements or everything above the least-working and add back on a piece at a time.

I.e. I dunno what's wrong, do you? How about mess with it and see what happens?

GoForSmoke:
I.e. I dunno what's wrong, do you? How about mess with it and see what happens?

You see that all the time here and it never works.

Or, if someone gets lucky, they have no idea why and then the problem reappears when they accidentally break the fix.

...R

If you are not methodical then you won't do well even learning from mistakes.