I wrote a simple serial program using Arduino Mega 2560, it is connected to COMPORT 10. Here is the program I Wrote,
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.println("HELLO");
delay(1000); //Send every one second
}
Now, I tried to send this message "Hello" to TeraTerm (COMPORT 1, for this I just hooked up Tx and Rx to the Arduino's Rx0 and Tx0. Doing this I do receive message in my TeraTerm screen but the received message doesn't make sense, its receiving garbage. Its not the case of mismatch of baud rate I am using 9600 on both the side.
However I do receive message "HELLO" in the serial monitor. Is there something I am doing wrong that I am not receiving message on TeraTerm.
2 Answers 2
... I just hooked up Tx and Rx to the Arduino's Rx0 and Tx0.
But neither device knows what voltage they are. You need to connect ground as well so that they have a common reference.
-
You mean the pin no 5 of the serial connector to the ground of the Arduino?Electronic Curious– Electronic Curious09/04/2015 08:20:43Commented Sep 4, 2015 at 8:20
-
Whatever ground is to whatever ground is.Ignacio Vazquez-Abrams– Ignacio Vazquez-Abrams09/04/2015 08:22:12Commented Sep 4, 2015 at 8:22
-
This still doesn't help, I am still receiving same kind of message, nothing changed :\Electronic Curious– Electronic Curious09/04/2015 08:30:44Commented Sep 4, 2015 at 8:30
-
These devices are already connected via USB. Apart from implementing some type of opto or galvanic isolation, not much else we can do, yeah?RYS– RYS09/04/2015 11:15:11Commented Sep 4, 2015 at 11:15
Hello everyone thanks for your reply,
I found the problem :D and was also able to solve it.
I was directly connecting the Tx and Rx pin of Arduino to the Rx and Tx pin of DB9 connector on PC. Since, DB9 on the PC operates on higher voltage than the operating voltage of the Arduino which is 5V. This mis-match of the voltage was causing the problem, So in order to solve this i added a level shifter in between (MAX232) and now it works perfect.
Thanks everyone for replying.
it is connected to COMPORT 10
...COMPORT 1, for this I just hooked up Tx and Rx to the Arduino's Rx0 and Tx0
. You've lost me here. You connected what to what?