Platform: Uno R3
OS: Windows
Terminal: serial monitor and br@y terminal.
Update: While the original problem is still valid, I decided to do the loopback test to see what the results of that would be. It seems like there is a definite issue, that is much worse at lower baudrates, but I'll leave the original post in anyways.
The issue isn't noticed when typing slowly, but when using a terminal macro to send a string the issues are noticable. This is why I probably didn't notice it as much using the wifly passthrough because I was typing out commands, but outputting the data coming back from the wifly was often garbled.
Ideas?
9600: (clicking the macro button slowly).
This Is A Test
st
This Is A TeThis Is A Test
This Is A Test
This Is A Test
Is A Test
This
This ThITest
This ThIThis
s A Test
s A This
s A Is A Test
s A This
115200:
This Is A Test
This Is A Test
This Is A Test
Is A Test
ThiA This Is A Test
This Is A Test
This Is A Test
This Is A Test
This Is A Test
This Is A Test
This Is A Test
This Is A Test
This Is A Test
This Is A Test
s A Test
Thi TeTest
Thi TeThis s A This Is A Test
This Is A Test
This Is A Test
This Is A Test
This Is A Test
Original Post:
I originally started out this project with a wifly shield, communicating with the wifly over softwareserial. I was getting some strange output when using the arduino as a passthrough terminal to the wifly (for testing commands etc without having to breadboard it). It worked fine most of the time, especially for sending, but a lot of the time the data coming back would get garbled and sometimes repeated. Some of that I think was not flushing the buffer correctly before looping, but I thought the issues were probably with the softwareserial communication.
I eventually stripped everything back off and realized that simple serial output from the uno to the terminal had problems. I don't have a lot of experience with arduino (I've done straight avr programming with avrlibc in the past), so I want to see if perhaps I'm missing something simple. There is no extra configuration, no wires at all, just the standalone board, no jumpers. I have tried different baudrates with no noticeable difference.
I have a ttl->rs232 converter in the mail, at which case I was planning on using that with a usb->serial converter I have to see if perhaps its something else, but that will take several days.
Any ideas? Am I going crazy?
Thanks.
Using Serial.write:
Code:
void setup()
{
Serial.begin(9600);
}
void loop() // run over and over
{
if(Serial)
{
Serial.write("HelloWrite\r");
Serial.flush();
}
delay(500);
}
Output:
HelloWrite
HelloWrite
Write
Heitee
HeiteHelloWritHelloWrite
HelloWrite
rite
Hete
WHelloWrite
HelloWriteloWrite
HelloWriteHeWite
HelloWriteHeWHte
oWrite
oWrHee
oWrHelloWrite
te
He
loWrioWrite
loWriHWrite
loWriHWriHe
loWriHelloWrite
Write
HeiteWrite
HeiteHeitee
HeiteHeiteHelloWritHelloWrite
Using Serial.println:
Code:
void setup()
{
Serial.begin(9600);
}
void loop() // run over and over
{
if(Serial)
{
Serial.println("Hello1234");
Serial.flush();
}
delay(500);
}
Output:
Hello1234
Hello1234
Hello1234
Hello1234
Hello1234
Hello1234
Hello1234
Hello1234
lo1234
He134
He1Hello12Hello1234
Hello1234
o1234
Hel3Hello1234
o1234
H123Hello1234
1234
He34
1234
Hel4
Hello1234
234
H34
1Hello1234
234
He4
1Hello1234