Changing Baud Rate Doesn't Work

And if you do not put a delay in your loop it's going to execute the serial.println statement thousands of times every second which will result in totally unpredictable results.

MikMo:
And if you do not put a delay in your loop it's going to execute the serial.println statement thousands of times every second which will result in totally unpredictable results.

What will be unpredictable?
Irritating and repetitive, maybe, but not unpredictable.

Yes, I've changed the baudrate in the serial monitor as I mentioned in the question.

I'll test it later but can anyone verify the answer to add a delay?

dmor574:
I'll test it later but can anyone verify the answer to add a delar?

It takes about 20 seconds to test...

There is no reason this won't work. Anyway, have you tried the examples in Arduino example yet?

Sorry, I wasn't home when I posted this question. The following code gives me an output of: "áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'áfr'á" endlessly with the serial monitor set to 14400 baud with newline. I tested other options in serial monitor drop down as well.

void setup() {
  Serial.begin(14400);
}

void loop() {
  Serial.println("Test");
  delay(100);
}

I also looked at other examples, but most have a baud rate with 9600 (which always works perfectly).

Some why do you have to use that non-working baud rate? Read the source code and see what actual rate is used?

bump.

Edit: I recently purchased a Pololu Dual VNH5019 Motor controller and tested it for the first time using their arduino library downloaded here: GitHub - pololu/dual-vnh5019-motor-shield: Arduino library for the Pololu Dual VNH5019 Motor Driver Shield

I uploaded the "demo" example to my Mega and the serial connection worked with 115200 baud rate! This makes no sense since I tried this earlier today with a barebones program like the following without success:

void setup() {
Serial.begin(115200);
}

void loop() {
Serial.println("Test");
}

I tried it again now and it works. Although no other baud rates work still. For those telling me to deal with it or just use what works, this doesn't answer my question! Why could this possibly happen... All I did was drag-n-drop the library into my arduino folder and a new baud rate works.

It appears all the answers to these questions just "randomly work"..I don't accept this :stuck_out_tongue:

Entirely predictable :wink: That's the sequence* you get when serial monitor is set at 9600 baud.

What is the baud rate you see when you open the serial monitor? 9600, 14400? The serial monitor can be overloaded by the stuff it receives from the Arduino, and your changes will be ignored. So, in your sketch try to set a delay such as 5000 - it will not overload the serial monitor and allow you to set the baud rate. Then change again the delay in the sketch to a smaller value and see what happens.

[edit]* I was referring to áfr'áfr'áfr'á...

Just to be safe, I tried the following:

void setup() {
  delay(5000);
  Serial.begin(14400);
  delay(5000);
}

void loop() {
  Serial.println("test");
  delay(500);
}

The results are: "ÈK;CË4ÈK;CË4ÈK;CË4ÈK;CË4ÈK;CË4ÈK;CË4ÈK;CË4ÈK;CË4ÈK;CË4ÈK;CË4ÈK;CË4ÈK;CË4ÈK;CË4ÈK;CË4ÈK;CË4ÈK;CË4ÈK;CË4ÈK;CË4ÈK;CË4ÈK;CË4ÈK;"

PS: Post any program and i'll try it and let you know the results.

Try this. Press and hold down the reset button on your board. Now close the serial port. Recheck that you have the correct serial port number selected in the tools menu. Then reopen the serial monitor and make sure the baudrate shown in the lower right is correct or change it if it's not. Now release the reset button.

Lefty

What will be unpredictable?
Irritating and repetitive, maybe, but not unpredictable.

If the receiving device is overwhelmed by the amount of crap you are sending to it,
the result may well be unpredictable.

Same program with the long delays

result: "nr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'"

And it has 5 second delays before calling serial begin and after, as well as a half second delay between loops.. this is plenty

Let's review what should happen (look especially at the leds on the Arduino):

  • you disconnect the Arduino, so any message still waiting in the serial buffer is cleared.
  • you reconnect the Arduino and upload your sketch: the TX and RX leds on the Arduino blink for a while. Then after 10 seconds (5000 + 5000 in setup()) the TX led stays on.
  • you open the serial monitor: the Arduino resets, (TX led off) after 10 seconds the TX led starts to blink, once every 500 msecs you receive some garbage in the serial monitor, in sync with the blink. You read in the serial monitor that the baud rate is --- not what you have written in the sketch.
  • you change the baud rate in the serial monitor window to 14400: the Arduino resets, after 10 seconds the TX led starts to blink, once every 500 msecs you receive the "test" string.

Does anything different happen in your setting?

My first thought is that your operating system (which OS?) is somehow interfering with your ability to change the serial baud rate. My second thought is that your preferences file may interfere with your ability to change the serial baud rate (look in the preferences.txt file somewhere in your user directory, there should be an entry serial.debug_rate).

dmor574:
I'm trying to change the baud rate on the serial transfer higher and there is no reason for this not to work with a barebones program.

void setup() {

Serial.begin(14400);
}

void loop() {
Serial.println("Test");
}

This sketch:

void setup() {
Serial.begin(14400);
}

void loop() {
Serial.println("Test");
delay (100);
}

On my Uno, produces this output, once I change the baud rate in the Serial Monitor:

Test
Test
Test
Test
Test
Test
Test
Test
Test
Test
Test

I have an Arduino Uno and tried this originally with no answer or solution and thought it was a hardware problem.

What do you mean?

Where did you buy the Uno? What operating system are you using?

I should warn you that, without any gap between transmissions, the auto-detect of the baud rate in the USB interface might be defeated.

dmor574:
Same program with the long delays

result: "nr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'ánr'"

And it has 5 second delays before calling serial begin and after, as well as a half second delay between loops.. this is plenty

You actually never mentioned is this result directly copy pasted from the serial monitor (with the wrong rate), or are you trying to receive the data with some other device. I'm guessing the former. Naturally the receiver has to receive the data at the same rate the sender is operating at. Same goes with the serial monitor on Arduino IDE. Or maybe you are not even using the IDE, I can't tell.

  • you change the baud rate in the serial monitor window to 14400: the Arduino resets

Changing the baud rate in the serial monitor doesn't reset the Arduino. At least, that has not been my experience.

PaulS:

  • you change the baud rate in the serial monitor window to 14400: the Arduino resets

Changing the baud rate in the serial monitor doesn't reset the Arduino. At least, that has not been my experience.

It does using IDE 1.0.3, just tested again using simple blink test that has no serial commands at all. Opening serial monitor resets the board and changing to any other baudrate also causes a reset.
Using windows XP SP3.
Lefty

Hi - I'm another Arduino Newbie.

For what its worth, I've had exactly the same problem as described by the original poster.

I was using Win XP SP 3, Arduino 1.0 IDE, Arduino Uno board.
Same problem - string of rubbish text whenever I changed the baud rate from default of 9600.

I ran the same code again, this time on a different laptop using Ubuntu 13, Arduino1:1.0.5 and the same Arduino Uno board.
The word "Test" appeared at all baud rates.

So I conclude that this is not a problem with the Uno or the Arduino IDE; it is a problem with Windows XP; although I don't understand what.
I suggest installing Ubuntu (It is really easy to set up as a dual boot if Windows is already installed), and running the Arduino IDE from Ubuntu rather than WIndows.

Hope this helps in some small way

Best wishes

Dave