Serial communications issue on pins 0 and 1 but not on USB?

Hello,

I can post the code if needed however I have a simple sketch to control a power distribution unit via RS232.

I have serial communications set up at a baud rate of 9600 on the sketch and all terminal emulators.

When I open a terminal emulator on the USB connection COM port I see the data being sent from the Arduino without an issue. Simple output shown below,

0x00
Cycle
recycle P61=2

The issue is when I open a terminam emulator to a COM port that is connected to pins 0 and 1 (and ground) on the arduino I am getting ascii garbage similar to what you would see if you had mismatched baud rates as shown below.

ëöëY=åë5¿_
åë5¿_
9'5¿_9

If I am not mistaken the serial output should be the same over USB and from pin 1 and 0 yet the data from pin 1 is always garbage.

Any insights?

Thanks!

terminam emulator to a COM port that is connected to pins 0 and 1

How is your com port connected to pins 0 and 1 ?

...R

I am using a USB to serial adapter connected to a DB9 cable I made up that has TX, RX, and GND wired to pins 1, 0, and GND respectively.

Hopefully that answers your question!

RS232 and TTL serial levels are different voltages and inverted. Are you taking this into account?

I did not know this so I am not taking it into account. I assumed I could just read off of the TX/RX pins just like from USB and it appears I assumed wrong!

Could you enlighten me how to take this voltage difference into account?

I think you have given me enough information to google the solution! It appears as though I will need a hardware device plugged inline to do the conversion? Something such as this: SparkFun RS232 Shifter - SMD - PRT-00449 - SparkFun Electronics

Thank you for your information!

I don't understand where the DB9 connector comes into the picture. The usual USB-TTL converter plugs into a PC's USB port and provide a 5v TTL signal Rx Tx and Gnd at the other end - this for example

If you already have a serial port on your PC with a DB9 connector you will, of course, need an RS232 - TTL converter. But then you would not need any USB - serial connector.

...R

Robin2:
I don't understand where the DB9 connector comes into the picture.

I will eventually be using this to control a power distribution unit that has a RS232 interface with a DB9 connector.

Currently for testing though I wanted to check the output with my computer. I was using a USB to RS232 adapter into my computer due to lack of a serial port on my computer. So yes for talking to the computer a USB to TTL would work fine but for the end product I will need TTL to RS232.

Hope that makes more sense!

The MAX232 chip comes to mind.

Idrake:
Hope that makes more sense!

Yes, but it would help if you provided a schematic showing how things are connected.

...R