Was this page helpful?

No Longer Recommended: 20 microseond-accuracy UTC clock via the USGlobalSat MR350P GPS

From $1

    2014 April 18: While this unit works well, we will likely soon recommend an alternative approach described here, which is easier to build and quicker to obtain a GPS fix.

    2014 April 02: The PPS-GPS connection schematic has been corrected.  The previous version incorrectly swapped the TX and RX lines, which would result in the sensorgnome not getting GPS fixes.  Our apologies to anyone who tried to build one according to that faulty diagram!

    SensorGnomes can use the USGlobalSat MR350P GPS for high-accuracy (~20 microsecond - needs verification) sync with UTC clocks.  Typical USB GPS units provide only ~1 second accuracy UTC sync.  The GPS serial cable connects to the beaglebone via a re-branded FTDI EVAL232R (ftdichip.com) USB/Serial converter.  The EVAL232R converts the serial interface to a USB interface, and provides power to the GPS.  The PPS signal from the GPS is a 2.85 V microsecond-long pulse every second, and is electrically compatible with the GPIO pins on the beaglebone P9 header.  We use pin 15 on this header by default.  We created patches (attached below) for the linux kernel to add this PPS signal and use the programs gpsd (for monitoring NMEA messages from the GPS) and chrony (for using the PPS signal to step and slew the beaglebone clock) to maintain a UTC-synchronized system clock.

    From a GPS cold start, it may take up to 5 minutes before the PPS signal is generated by the MR350P, and an additional minute or two before this signal is used to set the SensorGnome clock to UTC time with high accuracy.  On a GPS warm start, the whole process might complete by the time the beaglebone has finished booting.

    Schematic for MR350P GPS to EVAL232R / Beaglebone connections

    Note: this schematic had previously incorrectly reversed the TX and RX lines.  This was corrected 2014 April 2.

    The layout shows the view of the end of the plug on the MR350P GPS, which is the same view as on the inside of the mini-din jack; i.e. the side on which you need to solder the wires (or solder the rectangular header pins, with wires already attached to them. The PPS line is a straight-through  connection to slot 15 of header P9 on the beaglebone itself.  The end of that wire should be soldered to a rectangular connector pin, which will fit into the hole at slot 15 on P9.  The connection may be loose, but this can be fixed by very slightly bending the connector pin before insertion.  The top panel of the beaglebone case will help ensure the pin remains inserted.  The attached PDF version of the schematic can be zoomed.

    The +5VDC power and ground are obtained from pins 1 and 8 on jumper J2 of the Eval232R board.  RX and TX connect directly from the PS/2 cable to the appropriate (and opposite sense) pins on the DB9 serial connector, as shown.

    Note: connecting to the DB-9 within the constraints of the black project box may require removal of some or all of the metal shielding around that connector.


    Photos of Example Project Box

    Here is a simple project box that achieves this - note the cut-away portion of the metal housing on the DB-9 connector. 
    This could be avoided by use of a larger project box:

    The EVAL232R board is simply heat-glued to the bottom of the project box, into which appropriate
    holes have been cut/drilled for the USB port, the miniDIN connector, and the PPS wire.

    The wire emerging from the top side of the box gets plugged into pin 15 of header P9 on the beaglebone computer:



    Reprogramming the EVAL232 Board so it is recognized as a PPS-GPS by the SensorGnome

    Note: this step requires a computer running Windows with Microsoft .NET 4.0 framework, because FTDI doesn't provide a Mac version of their FTPROG utility.

    Download, install, and run the FTPROG utility from ftdichip.comto reprogram the EVAL232R USB/Serial adapter to give it the unofficial VID/PID we're using to indicate presence of a PPS GPS (vid=0xbd09, pid=0x0001).  There is a template file called SensorGnome_PPS_GPS.xml attached to this page which should be used to do this.  This rebranding allows us to distinguish the MR350P + PPS combination from other devices which might use the FTDI 232R USB/Serial interface. 

    1. Download, extract, and install the program FTPROG from ftdichip.com.
    2. Download the file SensorGnome_PPS_GPS.xml (right click on the link and choose Save Link as...) to your Desktop.
    3. Plug the EVAL232R into your computer via USB cable.
    4. Start the FTDI FTProg utility.
    5. Choose Devices | Scan and Parse from the FTDI menu.  You should see the following screen (a few details may differ, but the vendor ID and product ID should match):

    6. in the Device Tree window, right click on the first line (Device:0 ...) and choose Apply Template | From File:

    7. browse to your downloaded copy of SensorGnome_PPS_GPS.xml
    8. if successful, you'll see the message

    9. Choose Devices | Program from the menu to get this dialog:

    10. hit the Program button, and after a few seconds, the dialogue should display the
      message "Finished Programming" in the bottom left corner.
    11. To verify programming:  remove and then replug the EVAL 232R device into the Windows computer.  Windows
      should briefly display a message box in the bottom right corner of the Desktop like so:

      Unplug the EVAL232R now - do not attempt to install drivers for it on Windows.


    Internal software details (for SensorGnome developers)

    • we force recognition of the reprogrammed EVAL232R device using a udev rule to modprobe ftdi_sio (see attached udev rules file)
    • for some versions of the MR350P, you might have to force the device into using NMEA mode.  This is only required if the device does not appear to work and does not give sensible data via the gpsmon utility.  To do this, use gpsctl from the gpsutils package (version 3.7 or later) like so:
    gpsctl -n -t SiRF /dev/ttyUSB0
    • add kernel PPS support.  You need these settings in the kernel configuration, as well as one of the kernel patch files attached below:
    # PPS support
    # CONFIG_PPS_DEBUG is not set
    # PPS clients support
    # CONFIG_PPS_CLIENT_LDISC is not set
    Was this page helpful?
    Tags: (Edit tags)
    • No tags
    FileSizeDateAttached by 
    fix: need pps_gpio_platform_data.assert_falling_edge: true This patch is for the 3.2-series kernel included in the Angstrom Distribution of 2012.05, which only works for the beaglebone white.
    124.24 kB17:31, 24 May 2013johnActions
    kernel patches for debian 7.0 armhf kernel, which works on both beaglebone black and white models
    1594 bytes13:24, 3 Jul 2013johnActions
    photo of project box connecting PS/2 style barrel plug from MR350P GPS to FTDI EVAL232R USB/Serial adapter
    829.68 kB17:58, 12 Apr 2013adminActions
    connection of project box to beaglebone computer; red wire is PPS signal
    366.95 kB18:05, 12 Apr 2013adminActions
    a later, less cluttered version of the project box
    825.7 kB19:48, 2 Jul 2013johnActions
    FIXED: TX and RX lines had been switched on previous version
    33.41 kB15:45, 2 Apr 2014adminActions
    FIXED: TX and RX lines had been reversed on previous version
    79.39 kB15:45, 2 Apr 2014adminActions
    template file for FTDICHIP's FTPROG utility to set the USB VID/PID on the EVAL232R serial/USB adapter
    2.97 kB18:55, 22 May 2013johnActions
    device rules for SensorGnome running on beaglebone
    5.94 kB18:17, 12 Apr 2013adminActions
    Comments (0)

    Powered by MindTouch Core