Go Down

Topic: Changing Baud Rate on the fly (Read 460 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.
http://www.gammon.com.au/electronics

Go Up