Serial comms working on Serial Monitor but nowhere else

I have been trying to write a simple bit of code that talks between two boards (one Arduino and one other one).
There are certain commands and responses that I need to transfer between them.
However, that is not the real problem.
I have been trying and just could not get the communication to work.

I started off with an Arduino Mega so I could utilise different Serial ports on it.

While the data appears nice and clean via Serial Monitor, if I used Putty to probe the same or a different serial port, it just doesn’t work, and I get garbage.

For example, sending 1 gives me g, sending 2 gives me 3, sending f. As far as I can see, there is no corelation.

I have tried using a different MEGA, and getting the same issues.

So I have gone back to basics and wired up an Arduino UNO.

Here is the circuit:

Arduino UNO connected to computer via SERIAL Monitor.
Arduino UNO connected to PUTTY via a USB to Serial convertor.

This is the code I am running:

void setup()
{
    Serial.begin(9600);
}
void loop()
{

  Serial.println("Hello world!");
  delay(1000);

}

The following image shows that I get the proper output on COM5 via Serial monitor, and weird output if I plug in via a USB to Serial convertor, which is COM13.

If I use PUTTY to connect to COM5, I get the correct data, i.e. expected.

Any advice on what I could be doing wrong will be appreciated.

I have also tried different USB to serial convertors, devices that work fine for me for other purposes and to talk to other devices via SERIAL.

As far as communication goes, I have connected TX to RX0, RX to TX0 and Ground to Ground.

I have also tried a NULL modem to just make sure I haven’t made too much of an error.

The length of the wire is around a foot.

Any advice will be appreciated.

As can be seen from software, that is literally that is there, nothing else in the software or physically connected to the board.

The baud rates must always match.

Oh yeah, the baud rates are matching :slight_smile: Both are running at 9600 bps

On further research, it seems that there is a problem communicating between microcontrollers and PCs.
PCs work at up to -3V to +25V and such like.

Has anybody used a device like this to sort this out?
http://uk.farnell.com/texas-instruments/max3232eid/rs232-line-dvr-rcvr-250kbps-16soic/dp/1755050?MER=bn_search_1TP_SearchNB_4

Update

Have ordered some of these from RS to play with:
http://uk.rs-online.com/web/p/products/8829060/

Hopefully should sort the issue out.

I will report back on how well (or not) it works.

Image from Original Post so we don’t have to download it. See this Image Guide

02a3e6093d99714c6e9d13874de1188385b278f7.png

…R

oxgadgets:
Arduino UNO connected to computer via SERIAL Monitor.
Arduino UNO connected to PUTTY via a USB to Serial convertor.

I can't figure from that if you have the Uno connected via its USB cable and ALSO connected via the serial coverter to Pins 0 and 1 at the same time. You should NOT.

Is your converter USB-TTL (which is what you need) or USB-RS232 (which could damage your Arduino).

Have you a GND connection from the Arduino to the converter?

If you disconnect the Arduino USB connection before trying the converter how is the Arduino powered?

Try creating a second serial port on the Uno using SoftwareSerial and connect that to the serial-ttl converter.

I don't understand how you had problems with a Mega - it should be much easier to work with.

As far as communicating between two Arduinos is concerned have a look at Serial Input Basics

...R

PCs work at up to -3V to +25V and such like.

This is true only for old-fashioned RS232 serial ports (the actual voltages are typically -12 to +12 V). Most modern PCs do not have this type of port.

Please explain exactly how you are trying to make the connections between the Arduino and the PC, and what is the different between the cases that fail and those that work.