Quick Guide to PMTK Commands

Each GPS chip comes hard-programmed with certain parameters like update rate, baud rate, sentence selection, etc. that determine the output of the receiver. It is possible for the user to customize the output by sending commands over a serial interface to a GPS receiver. To configure a GPS receiver, it is important to know the chipset your GPS is using. The commands vary with chipset vendors. The following are command sets for some of the common chipsets

PMTK command is MediaTek proprietary data transfer protocol for GNSS. It enables configuring the parameters of the GNSS chipset, aiding assistance position information and receive notifications from the GNSS chip.

The PMTK commands are all send in a specific packet format which is shown below.

Preamble  Talker ID  Pkt Type  Data Field  *  CHK1 CHK2  CR LF

For example, consider the commands

$ PMTK 314 ,0,1,1,0,0,0,0,0,0,0,0,0,0,0 * 34

$ PMTK 314 ,0,1,5,0,0,0,0,0,0,0,0,0,0,0 * 30

  • Here the packet type i.e, 314 indicates that the command is to Set NMEA sentence output frequencies. Many other commands and their packet number are available.
  • The Datafield i.e, 0,1,1,0,0,0,0,0,0,0,0,0,0,0 indicates that RMC and VTG sentences will be output once every 1 position fix updates. In the second command, datafield 0,1,5,0,0,0,0,0,0,0,0,0,0,0 indicates that RMC will be output once every 1 position fix and VTG will be output once every 5 position fix updates
  • The is a checksum number 34 & 30 are used by the GPS to determine whether it has received the sentence accurately. It is calculated by XORing all the characters between $ and *. It needs to be recalculated every time you change the contents of the command so simply changing the Datafield will not work. To ease the process, you can use NMEA Checksum calculator.

The commands  can be given serially via any terminal software like Realterm. To know more about interfacing your GPS receiver to PC/Laptop, our previous tutorials on GPS modules comes in handy.

  • Open RealTerm with proper COM port (Verify it with Device Manager), 9600 baudrate and click Change button.

  • Now click Open button. You can see the port status on the bottom right corner of the window and the GPS data on the terminal

  • Switch to Send tab. You can paste the command in the box provided. Don’t forget to terminate the command string with <CR> and <LF>. For that in the EOL section check mark the first +CR and the first +LF. Now click Send ASCII button to send the command. The following screenshot highlights the command issued and its acknowlegement. After issuing the command, you can see that the GPS output contains only GPRMC and GPVTG sentences.
  • After issuing the second command, the output changed like this

Here are some more commands that we tried on our GPS Dongle

$ PMTK 251 ,38400 * 27   ——————->  Set Baudrate to 38400

$ PMTK 605 * 31              ——————->  Query Firmware info (Note that this is a query command and has no datafield)

$ PMTK 220 ,3000 * 1D     ——————->  Set Position fix interval as 3000ms

MiniGPS is a tool from MediaTek to view the status of GPS receiver more conveniently  and also acts as an interface to change the basic setting of GPS receivers.

NOTE : When the power of device (module) is removed, any modified setting will be lost and reset to factory default setting. If the device (module) has backup power supply through VBACKUP pin, it will be able to keep the modified setting until the backup power is exhausted.


Shop With Us

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">