Go Down

Topic: Changing Baud Rate Doesn't Work (Read 2139 times) previous topic - next topic

spatula

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).

Nick Gammon


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.

Code: [Select]

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

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



This sketch:

Code: [Select]
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:

Code: [Select]

Test
Test
Test
Test
Test
Test
Test
Test
Test
Test
Test


Quote

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.
Please post technical questions on the forum, not by personal message. Thanks!

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

Chaul


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.

PaulS

Quote
- 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.

retrolefty


Quote
- 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

Dave67

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

Go Up