baud-rates qustion

Hey guys,my problem is that i use the ublox gps, and my Xbee's module max baud rate is 9600 (100mW version). I tried changing the code a bit to:void loop()//Main Loop{navigation();stabilization();catch_analogs();Serial.begin(38400);decode_gps(); //Reads and average the GPS when is doing nothing...Serial.begin(9600);print_data(); //Function localted in "System" tab....It works, the gps locks, but i think it messed up the communications... it seems unstable. like some of the data gets lost. what do you think? shuld the change work?is it possible to change the baud rate of the ublox to 9600? i found explanations on how its done but with differnt gps modules...I am verry new to this, so any help i'll get will be verry apriciated! thanks!

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Developer
    The problem with your code is that the Serial.begin(38400) is in the wrong place. You could be receiving GPS while the timer is set to 9600. GPS comes in asynchronously. It does not wait for your decode_gps() line.

    This should work:

    void loop()//Main Loop
    {
    navigation();
    stabilization();
    catch_analogs();
    decode_gps(); //Reads and average the GPS when is doing nothing...
    if (data_update_event == 3){
    Serial.begin(9600);
    print_data(); //Function localted in "System" tab.
    Serial.begin(38400);
    }
    ...
  • Thanks for the answer. ok, its probably not a good idea to lower the gps baud rate, and the best solution is a new Xbee module. but what about changing the ardupilot baud rate before sending the telemetry? why didn't the code i wrote worked?

    thanks again.
  • 3D Robotics
    You can change the uBlox baud rate using uCenter, but I don't think you can do 4Hz updating, which is the whole point of the uBlox, at 9600. I'd upgrade your Xbees instead.
This reply was deleted.

Activity