Go Down

Topic: Problem with serial interface (Read 970 times) previous topic - next topic

t1mer

Hi, I have uploaded this sketch to my Arduino Mega2560 R3: http://pastebin.com/75p96kqC
Everytime I change the baud to anything higher than 9600 and connect via Hterm to the device it writes back "FO" multiple times, at least at 115200baud With other rates this output changes (Yes, i have set the rates in Hterm and sketch to the same value.)

This behaviour does not appear in the loop-back test (http://arduino.cc/forum/index.php/topic,73748.0.html)

Is this a known problem? Can it be fixed?

smeezekitty

Its not a known problem as far as I know.
The crystal or resonator could be defective and off frequency causing errors at high baud rates.
Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

cmiyc

Did you mean to use "Serial.print()" instead of "Serial.write()"?
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

t1mer


Did you mean to use "Serial.print()" instead of "Serial.write()"?


I did not send anything to the arduino. Serial.available() should always be 0. => no output


Its not a known problem as far as I know.
The crystal or resonator could be defective and off frequency causing errors at high baud rates.


mh... this would mean that the rest of the communication is affected too (right?). But the garbage is only sent immediately after starting the connection.

nickgammon

I'm not too surprised. I tend to get a few garbage bytes at the start of running a sketch. It's an unavoidable side-effect of the USB interface not being sure what baud rate you are running at.

You could wait a few milliseconds and then discard any input you have so far.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Go Up