Serial comm problem

Hello to everyone,
I have a problem to connect my UNO or Mega over RS232 converter to use serial command.
If I connect converter directly to RS232 port on my PC then it works. If I use direct cable(2M), then it is not working. Tried 2 converters and have no luck. Cable is OK too.
Thank you for your help
Michal

Please confirm you are using a USB to serial converter. You say it works when the converter is connected directly to your PC RS232 port. Most converters have a USB and male RS232 connection.

Please post a picture of the cables you are using.

Weedpharma

I am using native connector in notebook. Today I was able to send data over cable with new TTL to rs232, but after a while bad characters was present and later communication stops.
I made a program which sends string with Serial.write every 3 seconds, but whatever I do it is not working more than 30 seconds.
Problem occurs with or without cable.
I need to have working serial conection from arduino for my projects, but have no luck.
I tried change baudrate, arduinos, TTL to RS232, external adapter for arduino, USB power and no change.

I realy don´t know what i´m doing wrong.
Thanks for help..
Michal

Please put your code in its own window as seen in other posts. This can be done by placing     [code]  and [/code]  around the code or use the </> icon. This makes it easier for others to read.

We need to work out if the problem is software or hardware related.

Weedpharma

MichalNeo:
Hello to everyone,
I have a problem to connect my UNO or Mega over RS232 converter to use serial command.
If I connect converter directly to RS232 port on my PC then it works. If I use direct cable(2M), then it is not working. Tried 2 converters and have no luck. Cable is OK too.
Thank you for your help
Michal

Trying to understand. You have a serial port (or a USB/RS232 cable) on your PC. You connect a RS232 converter to the PC and the other side of the converter to the Arduino and it works.

Next you take out the RS232 converter and it does not work.

I assume that the RS232 converter converts RS232 signals to TTL signals; please provide a link to the product so we can be sure.

If that is what you're saying, be aware that RS232 uses different levels (12V / -12V versus 0V / 5V) and that the logic is inverted. So you can NOT directly connect a PC serial port to the Arduino without the RS232-to-TTL converter.

For test I am using this Code

void setup() {
Serial.begin(9600,SERIAL_8O1);
 
}
void loop()
{
  byte start[] = {0x10, 0xFF, 0x07, 0x00, 0x21,0x03,0x03};
Serial.write(start,sizeof(start));
delay(1000);

}

On the PC side is standard RS232 DB9 connector and on the arduino side is TTL to RS232 converter.
If I connect RS232 to TTL converter to DB9 connector, sending is ok for a while, then bad chars are present and then connection is lost.