Increasing GPS device (EM 406a) baudrate

Default baudrate of EM406a GPS device is 4800 baud. Then this baud rate dictates entire communication of serial port on ArduPilot - also those for Serial OUT (telemetry).

Here's simple way how to permanently increase baud rate of EM 406. Once done, the device will remember the baudrate, and you can increase serial speed in ArduPilot code.

1) Temporarily connect your GPS directly to FTDI cable:

Pin connection:
FDTI GPS
black <-> 5 (from right)
red <-> 1
orange <-> 3
yellow <-> 4
Note: I used original half-cut cable + connector left by this cable modification. No soldering, just careful wire plugging into FTDI connector.

2) Connect FTDI cable, and check if GPS works in RealTerm using default baudrate 4800:


3) Switch to Send tab in RealTerm:

and
1) type command $PSRF100,1,19200,8,1,0*38 in marked field
2) check +CR +LF line-ending
3) click "Send ASCII
This will configure your GPS device for 19200 baud rate.
I didn't test with higher baud rates, but if you change it, you'll need to recalculate command checksum (*38 at end), otherwise GPS won't accept the command.

4) Now GPS start to send at 19200 baud, so you'll see some garbage in RealTerm. Go to Port tab, close link (untick Open button), change baudrate to 19200, and Open link again. If you see valid GPS data, then all is OK:


5) In ArduPilot code, search for line Serial.begin(4800);
and change it to Serial.begin(19200);
Done! You have now faster serial communication in your ArduPilot code. GPS device will remember the baud speed as it has internal battery and memory and keeps the setting.
You're now prepared for more data to be sent by telemetry link.

Views: 6477


3D Robotics
Comment by Chris Anderson on January 29, 2009 at 10:17am
Michal: very nice! We stuck with 4800 because we wanted it to work "out of the box" but your suggestion is excellent, and a reminder that we should start a "pimp my ArduPilot" section for upgrades like this!

Developer
Comment by Jordi Muñoz on January 29, 2009 at 12:11pm
Michael,

The gps will return to the default state after 3 days of not using it...

I wrote a code long time ago to change the speed of the EM-406, to 38400bps, and switch to the Binary protocol, that is a lot better than the NMEA and reliable.. Then when i try to use it again i've discovered that the unit reset to the default settings after some days of leave it off.

You can check the code here.

I was planning to use this for another revision of ardupilot, if the current version still giving me problem i will switch to binary protocol.

Developer
Comment by Jordi Muñoz on January 29, 2009 at 12:17pm
Sorry was 57600bps,

Developer
Comment by Jordi Muñoz on January 29, 2009 at 12:20pm
This happens because the unit has a capacitor (not battery). In the other hand ublox saves it settings in the eeprom. The same trick you have post works with locosys, and it really has battery but not binary protocol... :/
Comment by Michal B on January 29, 2009 at 12:21pm
I'll test. Maybe just GPS battery was weak?

Developer
Comment by Jordi Muñoz on January 29, 2009 at 12:29pm
Well, and how i change it? is hard close, If was it a battery it suppose to recharge when you plug it (like the capacitor does), but i leave it all day powered when i was developing the code and testing it... The capacitor (like the average of the GPS have), is only for quick fix if you loose power for short periods... For example the paparazzi uBlox uses a capacitor too, and the sparkfun uBlox do not use anything, so if you loose power you need to wait a little bit more than Paparazzi. About the settings do not meters because is saved in the EEPROM. I also have the SIRF3 helix antenna, and you have to connect you own backup battery...
Comment by Michal B on January 29, 2009 at 12:41pm
Hmm, I gave it pause today for 8 hours, and settings persisted.
Em604 user guide says: "new parameters will be stored in battery backed SRAM".
I'll post more results after leaving GPS few days unplugged.

Developer
Comment by Jordi Muñoz on January 29, 2009 at 12:42pm
Maybe i have bad luck and my unit is damage or something.. :(...
Comment by Saiful Azuwan on February 12, 2009 at 8:15am
Michal, I'm using FTDI (bought from Sparkfun). Did you know how to connect it to EM406A? I need to change mine to 9600. Thanks
Comment by Michal B on February 12, 2009 at 8:32am
As shown in picture above, I made a very temporal connection on cut connector's wires.
Maybe it also works if you plug GPS and FTDI to ArduPilot, and program it as described above, then you don't need to make crazy wiring. But I didn't test if it works that way.

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2017   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service