arduino mega 2560 not working properly

hi , i am trying to check the serial1 pins tx, rx are working fine or not bcoz i was having problem while serial communicating with a meter so i decided to check if their any problem with arduino so i found this output comes after 10 times correct it starts showing only h again and again. i am using mega 2560.
:confused:

每hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
helhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

void setup()
{
聽 Serial.begin(9600);
聽 Serial3.begin(9600);
}
void loop()
聽 {
聽 Serial3.println("hello world"); 
聽 Serial.write(Serial3.read());
聽 delay(100);
聽 }

What is Serial3 connected to?!?

For testing i have serial 3 pins with each other rx is connected to tx.

Hey,

I test out the code with my Mega(clone) with nothing connected. And this is what i got

每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每

forever and ever

So we kinda have the same problem here :frowning:

In this thread, OP is using Serial1.

tib0n3:
Hey,

I test out the code with my Mega(clone) with nothing connected. And this is what i got

每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每

forever and ever

So we kinda have the same problem here :frowning:

And in this thread of tib0n3 you said that you did not get anything in the serial monitor. 每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每每 is not nothing.

What a waste of time.

Sir when i coonected a GPS device i don't get anything, but i add if available i get nothing.

Refer to this UART's not working with my MEGA - Project Guidance - Arduino Forum

Hi Delta_G,
sorry for incomplete sentence
I was trying to say that for testing i have connected serial 3 pins with each other means RX is connected to TX.
But i recently came know it's bcoz of overflowing the Serial3 software receive buffer and i don't the solution. Please,help me to sort out this.

Thanks,
Ransher

Ransher:
i recently came know it's bcoz of overflowing the Serial3 software receive buffer and i don't the solution.

Every 100 milliseconds you are sending 12 or 13 characters to Serial3 and only reading 1 back.
Try:

void loop()
  {
  Serial3.println("hello world"); 
  while (Serial3.available())
    Serial.write(Serial3.read());
  delay(100);
  }

That should pull characters from the input buffer fast enough that the buffer doesn't overflow.

Hi Delta_G,
I apologize for my bad english and in future i will keep that in my mind before starting a new topic.I was not trying to be rude nor talking like a boyfriend/girlfriend but trying to be as a student to gain some knowledge from professionals. Thanks, for giving me 2nd grade i do appreciate it.

Thanks,
Ransher

Hi johnwasser,

Thanks for replying me and now it's working fine.