0

GPS Ultimate Breakout default Baud Rate
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

GPS Ultimate Breakout default Baud Rate

by ThoroughB on Wed Apr 08, 2015 5:12 am

Is firmware available to change the default baudrate to 38400 or 57600?

ThoroughB
 
Posts: 3
Joined: Wed Apr 08, 2015 4:58 am

Re: GPS Ultimate Breakout default Baud Rate

by adafruit_support_rick on Wed Apr 08, 2015 9:46 am

You can change the baud rate with the PMTK251 command. The following code will change the baud rate from 9600 to 38400:
Code: Select all | TOGGLE FULL SIZE
SoftwareSerial mySerial(8, 7);
Adafruit_GPS GPS(&mySerial);

void setup() 
{
  // 9600 NMEA is the default baud rate for Adafruit MTK GPS's- some use 4800
  GPS.begin(9600);
//  GPS.sendCommand("$PMTK251,57600*2C");  //set baud rate to 57600
  GPS.sendCommand("$PMTK251,38400*27");  //set baud rate to 38400
//  GPS.sendCommand("$PMTK251,19200*22");  //set baud rate to 19200
//  GPS.sendCommand("$PMTK251,9600*17");  //set baud rate to 9600
  mySerial.end();
  GPS.begin(38400);



adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: GPS Ultimate Breakout default Baud Rate

by ThoroughB on Wed Apr 08, 2015 5:47 pm

Understood, I was hoping to change the default (startup) baud. Thanks for your response.

ThoroughB
 
Posts: 3
Joined: Wed Apr 08, 2015 4:58 am

Re: GPS Ultimate Breakout default Baud Rate

by adafruit_support_rick on Wed Apr 08, 2015 6:16 pm

That will change the startup baud rate, so long as you have the battery installed. You only need to run that code once.

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: GPS Ultimate Breakout default Baud Rate

by ThoroughB on Wed Apr 08, 2015 6:22 pm

Got it. Thanks!

ThoroughB
 
Posts: 3
Joined: Wed Apr 08, 2015 4:58 am

Re: GPS Ultimate Breakout default Baud Rate

by tatanka on Wed Apr 15, 2015 5:35 pm

Hello,
I am trying to bump my baud rate up myself. I am using an Arduino MEGA 2560, the GPS is on Serial1. Using the standard parsing sketch at 9600 I receive:
Code: Select all | TOGGLE FULL SIZE
Time: 21:31:48.0
Date: 15/4/2015
Fix: 1 quality: 1
Location: 3738.2644N, 9724.6445W
Location (in degrees, works with Google Maps): 37.6377, -97.4107
Speed (knots): 0.01
Angle: 0.00
Altitude: 397.70
Satellites: 5
$GPGGA,213149.000,3738.2645,N,09724.6449,W,1,5,1.95,397.5,M,-26.7,M,,*61
$GPGSA,A,3,11,09,19,23,28,,,,,,,,2.16,1.95,0.91*08
$GPRMC,213149.000,A,3738.2645,N,09724.6449,W,0.02,0.00,150415,,,A*7B
$GPVTG,0.00,T,,M,0.02,N,0.03,K,A*3C
$GPGGA,213150.000,3738.2645,N,09724.6449,W,1,5,1.95,397.3,M,-26.7,M,,*6F
$GPGSA,A,3,11,09,19,23,28,,,,,,,,2.16,1.95,0.91*08
$GPRMC,213150.000,A,3738.2645,N,09724.6449,W,0.01,0.00,150415,,,A*70
$GPVTG,0.00,T,,M,0.01,N,0.02,K,A*3E



But when I change the Parsing code to include this:

Code: Select all | TOGGLE FULL SIZE
// Test code for Adafruit GPS modules using MTK3329/MTK3339 driver
//
// This code shows how to listen to the GPS module in an interrupt
// which allows the program to have more 'freedom' - just parse
// when a new NMEA sentence is available! Then access data when
// desired.
//
// Tested and works great with the Adafruit Ultimate GPS module
// using MTK33x9 chipset
//    ------> http://www.adafruit.com/products/746
// Pick one up today at the Adafruit electronics shop
// and help support open source hardware & software! -ada

#include <Adafruit_GPS.h>
#include <SoftwareSerial.h>

// If you're using a GPS module:
// Connect the GPS Power pin to 5V
// Connect the GPS Ground pin to ground
// If using software serial (sketch example default):
//   Connect the GPS TX (transmit) pin to Digital 3
//   Connect the GPS RX (receive) pin to Digital 2
// If using hardware serial (e.g. Arduino Mega):
//   Connect the GPS TX (transmit) pin to Arduino RX1, RX2 or RX3
//   Connect the GPS RX (receive) pin to matching TX1, TX2 or TX3

// If you're using the Adafruit GPS shield, change
// SoftwareSerial mySerial(3, 2); -> SoftwareSerial mySerial(8, 7);
// and make sure the switch is set to SoftSerial

// If using software serial, keep this line enabled
// (you can change the pin numbers to match your wiring):
//SoftwareSerial mySerial(3, 2);

// If using hardware serial (e.g. Arduino Mega), comment out the
// above SoftwareSerial line, and enable this line instead
// (you can change the Serial number to match your wiring):

#define mySerial Serial1


Adafruit_GPS GPS(&mySerial);


// Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console
// Set to 'true' if you want to debug and listen to the raw GPS sentences.
#define GPSECHO  true

// this keeps track of whether we're using the interrupt
// off by default!
boolean usingInterrupt = false;
void useInterrupt(boolean); // Func prototype keeps Arduino 0023 happy

void setup() 
{
   
  // connect at 115200 so we can read the GPS fast enough and echo without dropping chars
  // also spit it out
  Serial.begin(115200);
  Serial.println("Adafruit GPS library basic test!");

  // 9600 NMEA is the default baud rate for Adafruit MTK GPS's- some use 4800
  GPS.begin(9600);
  //  GPS.sendCommand("$PMTK251,57600*2C");  //set baud rate to 57600
  GPS.sendCommand("$PMTK251,38400*27");  //set baud rate to 38400
//  GPS.sendCommand("$PMTK251,19200*22");  //set baud rate to 19200
//  GPS.sendCommand("$PMTK251,9600*17");  //set baud rate to 9600
  mySerial.end();
  GPS.begin(38400);
 
  // uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude
  GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
  // uncomment this line to turn on only the "minimum recommended" data
  //GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY);
  // For parsing data, we don't suggest using anything but either RMC only or RMC+GGA since
  // the parser doesn't care about other sentences at this time
 
  // Set the update rate
  GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);   // 1 Hz update rate
  // For the parsing code to work nicely and have time to sort thru the data, and
  // print it out we don't suggest using anything higher than 1 Hz

  // Request updates on antenna status, comment out to keep quiet
  GPS.sendCommand(PGCMD_ANTENNA);

  // the nice thing about this code is you can have a timer0 interrupt go off
  // every 1 millisecond, and read data from the GPS for you. that makes the
  // loop code a heck of a lot easier!
  useInterrupt(true);

  delay(1000);
  // Ask for firmware version
  mySerial.println(PMTK_Q_RELEASE);
}


// Interrupt is called once a millisecond, looks for any new GPS data, and stores it
SIGNAL(TIMER0_COMPA_vect) {
  char c = GPS.read();
  // if you want to debug, this is a good time to do it!
#ifdef UDR0
  if (GPSECHO)
    if (c) UDR0 = c; 
    // writing direct to UDR0 is much much faster than Serial.print
    // but only one character can be written at a time.
#endif
}

void useInterrupt(boolean v) {
  if (v) {
    // Timer0 is already used for millis() - we'll just interrupt somewhere
    // in the middle and call the "Compare A" function above
    OCR0A = 0xAF;
    TIMSK0 |= _BV(OCIE0A);
    usingInterrupt = true;
  } else {
    // do not call the interrupt function COMPA anymore
    TIMSK0 &= ~_BV(OCIE0A);
    usingInterrupt = false;
  }
}

uint32_t timer = millis();
void loop()                     // run over and over again
{
  // in case you are not using the interrupt above, you'll
  // need to 'hand query' the GPS, not suggested :(
  if (! usingInterrupt) {
    // read data from the GPS in the 'main loop'
    char c = GPS.read();
    // if you want to debug, this is a good time to do it!
    if (GPSECHO)
      if (c) Serial.print(c);
  }
 
  // if a sentence is received, we can check the checksum, parse it...
  if (GPS.newNMEAreceived()) {
    // a tricky thing here is if we print the NMEA sentence, or data
    // we end up not listening and catching other sentences!
    // so be very wary if using OUTPUT_ALLDATA and trytng to print out data
    //Serial.println(GPS.lastNMEA());   // this also sets the newNMEAreceived() flag to false
 
    if (!GPS.parse(GPS.lastNMEA()))   // this also sets the newNMEAreceived() flag to false
      return;  // we can fail to parse a sentence in which case we should just wait for another
  }

  // if millis() or timer wraps around, we'll just reset it
  if (timer > millis())  timer = millis();

  // approximately every 2 seconds or so, print out the current stats
  if (millis() - timer > 2000) {
    timer = millis(); // reset the timer
   
    Serial.print("\nTime: ");
    Serial.print(GPS.hour, DEC); Serial.print(':');
    Serial.print(GPS.minute, DEC); Serial.print(':');
    Serial.print(GPS.seconds, DEC); Serial.print('.');
    Serial.println(GPS.milliseconds);
    Serial.print("Date: ");
    Serial.print(GPS.day, DEC); Serial.print('/');
    Serial.print(GPS.month, DEC); Serial.print("/20");
    Serial.println(GPS.year, DEC);
    Serial.print("Fix: "); Serial.print((int)GPS.fix);
    Serial.print(" quality: "); Serial.println((int)GPS.fixquality);
    if (GPS.fix) {
      Serial.print("Location: ");
      Serial.print(GPS.latitude, 4); Serial.print(GPS.lat);
      Serial.print(", ");
      Serial.print(GPS.longitude, 4); Serial.println(GPS.lon);
      Serial.print("Location (in degrees, works with Google Maps): ");
      Serial.print(GPS.latitudeDegrees, 4);
      Serial.print(", ");
      Serial.println(GPS.longitudeDegrees, 4);
     
      Serial.print("Speed (knots): "); Serial.println(GPS.speed);
      Serial.print("Angle: "); Serial.println(GPS.angle);
      Serial.print("Altitude: "); Serial.println(GPS.altitude);
      Serial.print("Satellites: "); Serial.println((int)GPS.satellites);
    }
  }
}


I get this:
Code: Select all | TOGGLE FULL SIZE
Time: 0:0:0.0
Date: 0/0/200
Fix: 0 quality: 0
€€xøxxx€xxxx€x€xø€€€x€€ø€€xø€x€€øxxøxxxx€€€x€ø€€ø€€€x€€x€€€xø€€øø€ø€€€€x€€€€ø€ø€€ø€x€€xx€x€€€€€€€€€xxx€x€x€x€€xø€€x€x€xx€€€øxx€€øx€øx€xxx€€€€€€€x€€€xxx€ø€€x€ø€øx€x€€ø€øx€øxøx€€€€x€€€€€€xxx€€x€€xøxxx€xxxx€x€xø€€€x€€ø€€xø€x€€øxxøxxxx€€€x€ø€€ø€€€€€€€x€€€xø€€øø€ø€€€€x€€€€ø€ø€€ø€x€€xx€€ø€ø€€øxøxxx€€€€€€x€xxxx€€x€x€xx€øøx€x€€x€€€€€€xxøøø€€€€€€€x€€€€€x€€€€xxx€x€€x€x€€x€ø€ø€øxxøxx€
Time: 0:0:0.0
Date: 0/0/200
Fix: 0 quality: 0
€€xøxxx€xxxx€x€xø€€€x€€ø€€xø€x€€øxxøxxxx€€€x€ø€€ø€€€ø€€€x€€€xø€€øø€ø€€€€x€€€€ø€ø€€ø€x€€xx€€ø€øxøøø€øxxx€€x€xxx€€€ø€x€xx€øø€x€€x€€€€€€x€€xxøøø€€€ø€x€€€€€€€€€€xxx€x€€x€x€€x€ø€ø€øxxxxxøxx€€€xøxxx€xxxx€x€xø€€€x€€ø€€xø€x€€øxxøxxxx€€€x€ø€€ø€€€ø€€x€€€xø€€øø€ø€€€€x€€€€ø€ø€€ø€x€€xx€€ø€ø€€øxøxxx€€€€€€x€xxxx€€x€x€xx€ø€x€x€€x€€€€€xxøøø€€€€€€€x€€€€€x€€€€xxx€x€€x€x€€x€ø€ø€øxxxø€ø€
Time: 0:0:0.0
Date: 0/0/200
Fix: 0 quality: 0
€€xøxxx€xxxx€x€xø€€€x€€ø€€xø€x€€øxxøxxxx€€€x€ø€€ø€€€xø€€x€€€xø€€øø€ø€€€€x€€€€ø€ø€€ø€x€€xx€€ø€øxøøø€xxxxx€€x€xxx€€€ø€x€xx€€€€x€€x€€€€€øx€€€xxxøøø€€€ø€x€€€€€€€€€€xxx€x€€x€x€€x€ø€ø€øxxxxxøø€€€xøxxx€xxxx€x€xø€€€x€€ø€€xø€x€€øxxøxxxx€€€x€ø€€ø€€€€ø€€x€€€xø€€øø€ø€€€€x€€€€ø€ø€€ø€x€€xxx€€€€€€€€€øxx€x€x€x€€xø€€x€x€xx€øxøxxx€€x€øx€xxx€€€€€€€€€€xxx€€€€x€ø€øx€x€€ø€øxøøø€øx€€xx€€€€xx€€x
Time: 0:0:0.0
Date: 0/0/200
Fix: 0 quality: 0
€€xøxxx€xxxx€x€xø€€€x€€ø€€xø€x€€øxxøxxxx€€€x€ø€€ø€€€øø€€x€€€xø€€øø€ø€€€€x€€€€ø€ø€€ø€x€€xx€€€€€€€€€€xxx€x€x€x€€xø€€x€x€xx€øxøxx€€x€øx€xxx€€€€€€€€€€xxx€ø€€x€ø€øx€x€€ø€øxøøøxøx€€x€€€€€€xx€€x€€xøxxx€xxxx€x€xø€€€x€€ø€€xø€x€€øxxøxxxx€€€x€ø€€ø€€€€€x€€€xø€€øø€ø€€€€x€€€€ø€ø€€ø€x€€xx€x€€€øxøøø€xxx€x€x€x€€xø€€xxxx€€€øxx€€€x€€xxxxxx€€€€€€x€€€xxx€ø€€x€ø€øx€xxø€€€øxøx€€€€€€x€€€€€øxxxxxø€x
Time: 0:0:0.0
Date: 0/0/200
Fix: 0 quality: 0
€€xøxxx€xxxx€x€xø€€€x€€ø€€xø€x€€øxxøxxxx€€€x€ø€€ø€€€x€€x€€€xø€€øø€ø€€€€x€€€€ø€ø€€ø€x€€xx€xø€€€€€€€øxx€€x€x€€xø€€x€x€xx€øxøx€xxxø€ø€øx€xx€xøøx€€€€xxø€€€€x€€€øx€x€€ø€øxøøø€xxx€x€€xxxxxx€€€€€€xøxxx€xxxx€x€xø€€€x€€ø€€xø€x€€øxxøxxxx€€€x€ø€€ø€€x€€€x€€€xø€€øø€ø€€€€x€€€€ø€ø€€ø€x€€xx€x€ø€øxøøø€xxx€x€€xxx€€€ø€xxx€€€€xx€x€€€€€€x€€€xxxøøø€€€ø€xxø€€€€€€€€øx€x€€x€x€€x€ø€ø€øxxxxxøøx


Help! I would like to eventually get up to 56k4 if at all possible, I would also like to see 5Hz update rate on the NMEA sentences if possible.

Thanks

Tim

tatanka
 
Posts: 62
Joined: Tue Jul 03, 2012 9:06 am

Re: GPS Ultimate Breakout default Baud Rate

by adafruit_support_rick on Thu Apr 16, 2015 9:30 am

You can't use the interrupt at 38400, because it doesn't happen frequently enough.
I modified your code to read the GPS in loop():
Code: Select all | TOGGLE FULL SIZE
// Test code for Adafruit GPS modules using MTK3329/MTK3339 driver
//
// This code shows how to listen to the GPS module in an interrupt
// which allows the program to have more 'freedom' - just parse
// when a new NMEA sentence is available! Then access data when
// desired.
//
// Tested and works great with the Adafruit Ultimate GPS module
// using MTK33x9 chipset
//    ------> http://www.adafruit.com/products/746
// Pick one up today at the Adafruit electronics shop
// and help support open source hardware & software! -ada

#include <Adafruit_GPS.h>
#include <SoftwareSerial.h>

// If you're using a GPS module:
// Connect the GPS Power pin to 5V
// Connect the GPS Ground pin to ground
// If using software serial (sketch example default):
//   Connect the GPS TX (transmit) pin to Digital 3
//   Connect the GPS RX (receive) pin to Digital 2
// If using hardware serial (e.g. Arduino Mega):
//   Connect the GPS TX (transmit) pin to Arduino RX1, RX2 or RX3
//   Connect the GPS RX (receive) pin to matching TX1, TX2 or TX3

// If you're using the Adafruit GPS shield, change
// SoftwareSerial mySerial(3, 2); -> SoftwareSerial mySerial(8, 7);
// and make sure the switch is set to SoftSerial

// If using software serial, keep this line enabled
// (you can change the pin numbers to match your wiring):
//SoftwareSerial mySerial(3, 2);

// If using hardware serial (e.g. Arduino Mega), comment out the
// above SoftwareSerial line, and enable this line instead
// (you can change the Serial number to match your wiring):

#define mySerial Serial1


Adafruit_GPS GPS(&mySerial);


// Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console
// Set to 'true' if you want to debug and listen to the raw GPS sentences.
#define GPSECHO  true

// this keeps track of whether we're using the interrupt
// off by default!
boolean usingInterrupt = false;
void useInterrupt(boolean); // Func prototype keeps Arduino 0023 happy

void setup() 
{
   
  // connect at 115200 so we can read the GPS fast enough and echo without dropping chars
  // also spit it out
  Serial.begin(115200);
  Serial.println("Adafruit GPS library basic test!");

  // 9600 NMEA is the default baud rate for Adafruit MTK GPS's- some use 4800
  GPS.begin(9600);
  //  GPS.sendCommand("$PMTK251,57600*2C");  //set baud rate to 57600
  GPS.sendCommand("$PMTK251,38400*27");  //set baud rate to 38400
//  GPS.sendCommand("$PMTK251,19200*22");  //set baud rate to 19200
//  GPS.sendCommand("$PMTK251,9600*17");  //set baud rate to 9600
  mySerial.end();
  GPS.begin(38400);
 
  // uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude
  GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
  // uncomment this line to turn on only the "minimum recommended" data
  //GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY);
  // For parsing data, we don't suggest using anything but either RMC only or RMC+GGA since
  // the parser doesn't care about other sentences at this time
 
  // Set the update rate
  GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);   // 1 Hz update rate
  // For the parsing code to work nicely and have time to sort thru the data, and
  // print it out we don't suggest using anything higher than 1 Hz

  // Request updates on antenna status, comment out to keep quiet
  GPS.sendCommand(PGCMD_ANTENNA);

  // the nice thing about this code is you can have a timer0 interrupt go off
  // every 1 millisecond, and read data from the GPS for you. that makes the
  // loop code a heck of a lot easier!
  useInterrupt(false);

  delay(1000);
  // Ask for firmware version
  mySerial.println(PMTK_Q_RELEASE);
}


// Interrupt is called once a millisecond, looks for any new GPS data, and stores it
SIGNAL(TIMER0_COMPA_vect) {
  char c = GPS.read();
  // if you want to debug, this is a good time to do it!
#ifdef UDR0
  if (GPSECHO)
    if (c) UDR0 = c; 
    // writing direct to UDR0 is much much faster than Serial.print
    // but only one character can be written at a time.
#endif
}

void useInterrupt(boolean v) {
  if (v) {
    // Timer0 is already used for millis() - we'll just interrupt somewhere
    // in the middle and call the "Compare A" function above
    OCR0A = 0xAF;
    TIMSK0 |= _BV(OCIE0A);
    usingInterrupt = true;
  } else {
    // do not call the interrupt function COMPA anymore
    TIMSK0 &= ~_BV(OCIE0A);
    usingInterrupt = false;
  }
}

uint32_t timer = millis();
void loop()                     // run over and over again
{
  // in case you are not using the interrupt above, you'll
  // need to 'hand query' the GPS, not suggested :(
  if (! usingInterrupt) {
    while (mySerial.available())
    {
    // read data from the GPS in the 'main loop'
    char c = GPS.read();
    // if you want to debug, this is a good time to do it!
    if (GPSECHO)
      if (c) Serial.print(c);
    }
  }
 
  // if a sentence is received, we can check the checksum, parse it...
  if (GPS.newNMEAreceived()) {
    // a tricky thing here is if we print the NMEA sentence, or data
    // we end up not listening and catching other sentences!
    // so be very wary if using OUTPUT_ALLDATA and trytng to print out data
    //Serial.println(GPS.lastNMEA());   // this also sets the newNMEAreceived() flag to false
 
    if (!GPS.parse(GPS.lastNMEA()))   // this also sets the newNMEAreceived() flag to false
      return;  // we can fail to parse a sentence in which case we should just wait for another
  }

  // if millis() or timer wraps around, we'll just reset it
  if (timer > millis())  timer = millis();

  // approximately every 2 seconds or so, print out the current stats
  if (millis() - timer > 2000) {
    timer = millis(); // reset the timer
   
    Serial.print("\nTime: ");
    Serial.print(GPS.hour, DEC); Serial.print(':');
    Serial.print(GPS.minute, DEC); Serial.print(':');
    Serial.print(GPS.seconds, DEC); Serial.print('.');
    Serial.println(GPS.milliseconds);
    Serial.print("Date: ");
    Serial.print(GPS.day, DEC); Serial.print('/');
    Serial.print(GPS.month, DEC); Serial.print("/20");
    Serial.println(GPS.year, DEC);
    Serial.print("Fix: "); Serial.print((int)GPS.fix);
    Serial.print(" quality: "); Serial.println((int)GPS.fixquality);
    if (GPS.fix) {
      Serial.print("Location: ");
      Serial.print(GPS.latitude, 4); Serial.print(GPS.lat);
      Serial.print(", ");
      Serial.print(GPS.longitude, 4); Serial.println(GPS.lon);
      Serial.print("Location (in degrees, works with Google Maps): ");
      Serial.print(GPS.latitudeDegrees, 4);
      Serial.print(", ");
      Serial.println(GPS.longitudeDegrees, 4);
     
      Serial.print("Speed (knots): "); Serial.println(GPS.speed);
      Serial.print("Angle: "); Serial.println(GPS.angle);
      Serial.print("Altitude: "); Serial.println(GPS.altitude);
      Serial.print("Satellites: "); Serial.println((int)GPS.satellites);
    }
  }
}

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: GPS Ultimate Breakout default Baud Rate

by tatanka on Thu Apr 16, 2015 10:08 am

Had to add a delay to make it work:

Code: Select all | TOGGLE FULL SIZE
// 9600 NMEA is the default baud rate for Adafruit MTK GPS's- some use 4800
  GPS.begin(9600);
  //GPS.sendCommand("$PMTK251,57600*2C");  //set baud rate to 57600
  GPS.sendCommand("$PMTK251,38400*27");  //set baud rate to 38400
  //GPS.sendCommand("$PMTK251,19200*22");  //set baud rate to 19200
  //GPS.sendCommand("$PMTK251,9600*17");  //set baud rate to 9600
  mySerial.end();
  delay(1000);
  GPS.begin(38400);


Otherwise it worked like a charm. Thanks!

Unfortunately it had the opposite effect of what I was looking for. With the baud rate at 9600 and 1Hz refresh, the oldest sentence I received was around 900 ms with most refresh happening in the 500-700 ms range. I tried 38400, 5 Hz refresh rate, the average age of the refresh moved UP to 1.5 sec, with a high of around 3 sec!

I have the 10DOF on I2C, and another serial device on Serial2, plus sending all this information to the computer on Serial. I guess for the time being I will have to be happy with about 1 Hz.

Tim

tatanka
 
Posts: 62
Joined: Tue Jul 03, 2012 9:06 am

Re: GPS Ultimate Breakout default Baud Rate

by carfreemaine on Sun Apr 26, 2015 2:10 pm

Hello,
I want to use my Ultimate GPS module with a Naze32 Flight Controller which AFAIK requires a 115200 Baudrate and a 10Hz update rate. Thus far I've tried accomplishing this using the PMTK commands in the Arduino serial monitor, and with two different versions of the MTK3339 Firmware Flasher. I've also tried checking the firmware version with the MiniGPS tool and via PMTK command. While I can connect and see when I have a fix in the NMEA sentences, none of the above mentioned methods have allowed me to make any modifications to the baud rate or update rate, or update/check the firmware version.

I have tried connecting directly (TX-TX, RX-RX) and via the echo sketch (TX-RX, RX-TX) using an Arduino Uno and through an FTDI adapter (TX-RX, RX-TX). No matter what I try, I can't get out of using the 9600 baud and 1Hz update rate... Is there anything I can do to fix this problem or is the Ultimate GPS Module just not cut out for use on a UAV?

Note- One of the soldering pads to the battery came apart so I no longer have use of the battery. I also have a Flora GPS that I was reserving for wearable applications, but I could use it for debugging purposes if necessary.

carfreemaine
 
Posts: 26
Joined: Wed Oct 24, 2012 1:02 pm

Re: GPS Ultimate Breakout default Baud Rate

by adafruit_support_mike on Sun Apr 26, 2015 4:45 pm

What $PMTK sentences are you sending to the module?

adafruit_support_mike
 
Posts: 54144
Joined: Thu Feb 11, 2010 2:51 pm

Re: GPS Ultimate Breakout default Baud Rate

by adafruit_support_rick on Mon Apr 27, 2015 10:27 am

Yes. Post the code you're using to change the baud rate and update rate

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: GPS Ultimate Breakout default Baud Rate

by carfreemaine on Mon Apr 27, 2015 1:09 pm

I've tried a number of different approaches but the very first thing I tried was simply to run the "echo" sketch from the library in order to use the serial monitor to send the PMTK commands. The first command I tried was the firmware query command
Code: Select all | TOGGLE FULL SIZE
$PMTK605*31
and it just continued displaying coordinates without interruption.
When this didn't work, I went and tried it with every different "RMC" option commented/uncommented out but it made no difference, and I also made sure that I had both NL and CR checked on the serial monitor. I then tried the same method (using the serial monitor) using direct wiring and a blank sketch this time and again... No reaction...
The same situation repeats itself when I use other GPS tools like MiniGPS or the GlobalTOp Flashing Tool... It will connect just fine at 9600 baud, and will display a fix and coordinates, but it won't respond to any other command. It wouldn't even give me the firmware version in MiniGPS!

I will try the same steps on the Flora GPS in case something changes...

Ultimately, I was trying to change the settings according to the tutorial steps posted at http://www.camelsoftware.com/firetail/b ... date-rate/ which recommends the following snippet of code to first change the buad rate to 38400-

Code: Select all | TOGGLE FULL SIZE
 //switch the GPS baud rate to 38400
    Serial1.write("$PMTK251,38400*27\r\n");
    //change baud rate of serial port to 38400
    Serial1.flush();
    delay(10);
    Serial1.end();
    Serial1.begin(38400);


and the following command to change to 10Hz-
Code: Select all | TOGGLE FULL SIZE
$PMTK220,100*2F\r\n

carfreemaine
 
Posts: 26
Joined: Wed Oct 24, 2012 1:02 pm

Re: GPS Ultimate Breakout default Baud Rate

by adafruit_support_rick on Mon Apr 27, 2015 4:47 pm

There's code to change the baud rate earlier in this thread. Have you tried that?

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: GPS Ultimate Breakout default Baud Rate

by carfreemaine on Tue Apr 28, 2015 12:55 pm

adafruit_support_rick wrote:There's code to change the baud rate earlier in this thread. Have you tried that?


Yes, I did try it and it wouldn't compile whether I had an Arduino Uno or Flora selected. This is the error output for the Uno-

Code: Select all | TOGGLE FULL SIZE
Arduino: 1.6.3 (Windows 7), Board: "Arduino Uno"

Baudchangegps.ino:1:1: error: 'SoftwareSerial' does not name a type

Baudchangegps.ino:2:1: error: 'Adafruit_GPS' does not name a type

Baudchangegps.ino: In function 'void setup()':

Baudchangegps.ino:7:3: error: 'GPS' was not declared in this scope

Baudchangegps.ino:12:3: error: 'mySerial' was not declared in this scope

Error compiling.


Is there any reason why I would have to use SoftwareSerial?

In any case, I did manage to load up the FloraTest.ino example with my FloraGPS and I was able to issue the $PMTK605*31 command in the serial monitor and receive the following reply-

Code: Select all | TOGGLE FULL SIZE
$PMTK705,AXN_2.10_3339_2012072601,5223,PA6H,1.0*6A


So at least I know the Flora GPS is responsive. If all else fails, I suppose I could use that module on the UAV instead, but I'd rather reserve it for the wearable applications it was intented for...

carfreemaine
 
Posts: 26
Joined: Wed Oct 24, 2012 1:02 pm

Re: GPS Ultimate Breakout default Baud Rate

by adafruit_support_mike on Tue Apr 28, 2015 1:27 pm

The errors are saying the compiler can't find the GPS library. Make sure that's in your sketchbook/libraries folder.

A Flora can use hardware serial and still communicate through the Serial Monitor because it handles the USB-Serial in hardware independently of the chip's hardware UART. The Uno sends its Serial connection through the hardware UART, so that one needs to use SoftwareSerial if you apwant both kinds of communication.

adafruit_support_mike
 
Posts: 54144
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.