Go Down

Topic: Changing Baud Rate on the fly (Read 522 times) previous topic - next topic

P18F4550

Hello,What is wrong with this, is it possible to change baud rate? Im using a Mega1280 and i want to change the baud rate of the GPS from default 4800 to 57600 but all i get is rubbish in the Arduino debug window, it works fine if i connect the gps to a windows terminal
Code: [Select]
  Serial1.begin(4800);
  Serial1.println("$PSRF100,1,57600,8,1,0*36");
  Serial1.begin(57600);
  Serial.begin(9600);

Thanks

Coding Badly


Try calling Serial1.end(); when you are finished communicating at 4800 baud.

P18F4550


Nick Gammon


it works fine if i connect the gps to a windows terminal


When you use the Terminal window, do you type the command a few microseconds apart? That is your answer.
Please post technical questions on the forum, not by personal message. Thanks!

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

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy