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.
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 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.
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.