Serial Port Progrmming

Hello,

I am trying to user Serial port 1 in Ardunio Mega 2560, I have referred example in following link with small modifications. But i could not see any data other end (Connected to PC Tera term) of the serial port.

Simple Code

void setup() {

Serial1.begin(9600);
delay(100);

}

void loop() {
Serial1.print("Hello");
delay(1000);
}

Thank You
Babu a

But i could not see any data other end (Connected to PC Tera term) of the serial port.

Connected how? The Serial1 port is not connected to the USB cable.

PaulS:
Connected how? The Serial1 port is not connected to the USB cable.

Host machine connected over USB-Serial Converter with common ground. Typical Block Diagram attached.

USB-Serial.png

You connected to RX and TX on the Arduino; you need to connect to RX1 and TX1.

You might have done that correctly but it does not show and hence typical diagram does not work; make an exact drawing with the USB-Serial in there.

Is it a USB-to-TTL or USB-to-RS232? Please provide link to the specs of the USB-Serial.

sterretje:
You connected to RX and TX on the Arduino; you need to connect to RX1 and TX1.

It was type mistake, Actually connected to RX1 and TX1

You might have done that correctly but it does not show and hence typical diagram does not work; make an exact drawing with the USB-Serial in there.

Is it a USB-to-TTL or USB-to-RS232? Please provide link to the specs of the USB-Serial.

It is USB-RS232,

USB-Serial converter details:
http://www.bafo.com/index.php/products/adapter/usb-cable-adapter/bf-812-usb-to-serial-adapter-db9.html

Regards
Babu A

You can not directly connect RS232 levels to an Arduino.

sterretje:
You can not directly connect RS232 levels to an Arduino.

If not, how should i connect ..?

With your current setup, use e.g. a MAX232 to convert the RS232 signals back to TTL levels.

Or get a USB-to-TTL cable instead of USB-to-RS232.

Note1:
RS232 uses -3 to -18V for a logic one and +3 to +18V for a logic zero; usual levels probably -12V and +12V

Note2:
From note 1, you might have damaged your mega RX1 pin; it does not really like negative signals nor can it handle voltages above 5V. You will have to test it and actually have to test the complete Mega.

sterretje:
With your current setup, use e.g. a MAX232 to convert the RS232 signals back to TTL levels.

Or get a USB-to-TTL cable instead of USB-to-RS232.

Note1:
RS232 uses -3 to -18V for a logic one and +3 to +18V for a logic zero; usual levels probably -12V and +12V

Note2:
From note 1, you might have damaged your mega RX1 pin; it does not really like negative signals nor can it handle voltages above 5V. You will have to test it and actually have to test the complete Mega.

Thank You very much for detailed information..
I will verify the Mega and buy the USB-TTL converter.

Thank You
Babu A