Changing Baud Rate on the fly

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

  Serial1.begin(4800);
  Serial1.println("$PSRF100,1,57600,8,1,0*36");
  Serial1.begin(57600);
  Serial.begin(9600);

Thanks

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

Thanks, Will do

P18F4550:
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.