I am not quite shure if this topic was already discussed.

I tried today the binary mode on the mediatek module. The Longitude error, which was discussed earlier is still there, but i will update the firmware tomorrow, when i have access to a windows computer. 

When switching to Binary mode with the 

 Serial1.print("$PGCMD,16,0,0,0,0,0*6A\r\n");

the module goes into binary mode, but the output frequency is still 1Hz.

How can the update rate be switched to 10Hz?

The NMEA switching commands commands are only made to switch the frequency of the NMEA sentences.

Is there any way to switch it or is this automatically done with the new firmware ?



Tags: 10Hz, Mediatek, rate, update

Views: 332

Reply to This

Replies to This Discussion

Harold, please check the APM MTK library files. They should have the setup strings that switch the module to higher rate.
Hi Chris,

i have checked the APM library, basically it is the same code, that runs on the AP. The init string for the MTK is the same as on the AP V2_17 software. There is no special init for higher update rates. I will check the new firmware for the MTK tomorrow. I still think, that on the new firmware, the update rate is automatically switched to 10Hz, when entering binary mode.
-Change unit refresh rate:
$PMTK220,100*2F //Will set the GPS to 10hz (or updates every 100 milliseconds)
$PMTK220,250*29 //Will set the GPS to 4hz (or updates every 250 milliseconds)
$PMTK220,1000*1F //Will set the GPS to 1hz (updates every 1000 milliseconds)

You can set the GPS to any desired refresh rate, you change the value inside the string and generate a new check sum here: http://www.hhhh.org/wiml/proj/nmeaxor.html

ref. https://docs.google.com/Doc?docid=0ASI4WbhJsiyqZDk3MndtYl8yN2R2ajVm...
Thanks Ken, this helps a lot!

i will try this today.
Where is this information from? I have read all the available "official" manuals for the MTK, but have not found the MTK220 sentence.

regards
Harald
From the libraries, (AP_GPS_MTK.h)


#include
#define MAXPAYLOAD 32

#define MTK_SET_BINARY "$PGCMD,16,0,0,0,0,0*6A\r\n"
#define MTK_SET_NMEA "$PGCMD,16,1,1,1,1,1*6B\r\n"

#define MTK_OUTPUT_1HZ "$PMTK220,1000*1F\r\n"
#define MTK_OUTPUT_2HZ "$PMTK220,500*2B\r\n"
#define MTK_OUTPUT_4HZ "$PMTK220,250*29\r\n"
#define MTK_OTUPUT_5HZ "$PMTK220,200*2C\r\n"
#define MTK_OUTPUT_10HZ "$PMTK220,100*2F\r\n"

#define MTK_BAUD_RATE_38400 "$PMTK251,38400*27\r\n"

#define SBAS_ON "$PMTK313,1*2E\r\n"
#define SBAS_OFF "$PMTK313,0*2F\r\n"

#define WAAS_ON "$PSRF151,1*3F\r\n"
#define WAAS_OFF "$PSRF151,0*3E\r\n"
Ken,

thanks, i think i have looked at the wrong libraries ;-)
Can anyone provide any direction for this:
"You can set the GPS to any desired refresh rate, you change the value inside the string and generate a new check sum here: http://www.hhhh.org/wiml/proj/nmeaxor.html"
How does one update the check sum?

I've looked through a couple of other posts regarding the same thing. I'm working with the "GPS_MTK.h" library, alternatively, can I add the following line of code to my "GPS_MTK.cpp" file:
void GPS_MTK_Class::Init(void)
{
//Add this line
_port->print(MTK_OUTPUT_10HZ);

ck_a=0;
ck_b=0;
UBX_step=0;
NewData=0;
Fix=0;
PrintErrors=0;
GPS_timer=millis(); //Restarting timer...
// Initialize serial port
#if defined(__AVR_ATmega1280__)
Serial1.begin(38400); // Serial port 1 on ATMega1280
#else
Serial.begin(38400);
#endif
}

Appreciate any assistance you could provide.

Thanks,

Nick
Nick,

if i understand you right, you want to do a fixed init function for your GPS inside the GPS_MTK lib.

The predefined strings "MTK_OUTPUT_xxHZ" already contain the checksum, so there is no need to recalculate it if you use this #defines.
So the "_port->print(MTK_OUTPUT_10HZ);" should work.

BUT: you have to do the initialization of the serial port BEFORE you send out this string.

hope this helps...
Thanks for the reply, Harald.

Yes, that's correct, I'm trying to set the MTK up for 10 Hz updates. My .cpp file already has the "void GPS_MTK_Class::Init(void)" - I'm simply hoping to add that MTK_OUTPUT_10HZ line.

I don't quite follow your final comment, however. How does one "initialize the serial port" before? My .cpp file starts as follows:
#include "GPS_MTK.h"
#include
#include "WProgram.h"

// Constructors ////////////////////////////////////////////////////////////////
GPS_MTK_Class::GPS_MTK_Class()
{
}

// Public Methods //////////////////////////////////////////////////////////////
void GPS_MTK_Class::Init(void)
{
...as pasted above...
}
...etc

Thank you again.

-Nick
Nick,

i menat the Serial.begin() or Serial1.begin() methods. Prior to sending anything to the USART port you have to initialize the port first with the correct baudrate.
For that, you have to put the call to the _port_print method to the end of the Init method and not to the begin:



"GPS_MTK.cpp" file:
void GPS_MTK_Class::Init(void)
{

ck_a=0;
ck_b=0;
UBX_step=0;
NewData=0;
Fix=0;
PrintErrors=0;
GPS_timer=millis(); //Restarting timer...
// Initialize serial port
#if defined(__AVR_ATmega1280__)
Serial1.begin(38400); // Serial port 1 on ATMega1280
#else
Serial.begin(38400);
#endif

//Add this line
_port->print(MTK_OUTPUT_10HZ);

}

RSS

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Groups

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service