gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] Possible error report


From: Eric S. Raymond
Subject: Re: [gpsd-dev] Possible error report
Date: Fri, 8 Nov 2013 13:18:03 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

Andy Walls <address@hidden>:
> The documentation on the actual pulse width setting itself sucks.

Thank you for posting it.  Here is how the handler now reads:

    case 424:                   /* PPS pulse width response */
        /*
         * Response will look something like: $PMTK424,0,0,1,0,69*12
         * The pulse width is in field 5 (69 in this example).  This
         * sentence is poorly documented at:
         * 
http://www.trimble.com/embeddedsystems/condor-gps-module.aspx?dtID=documentation
         *
         * Packet Type: 324 PMTK_API_SET_OUTPUT_CTL
         * Packet meaning
         * Write the TSIP / antenna / PPS configuration data to the Flash 
memory.
         * DataField [Data0]:TSIP Packet[on/off]
         * 0 - Disable TSIP output (Default).
         * 1 - Enable TSIP output.
         * [Data1]:Antenna Detect[on/off]
         * 0 - Disable antenna detect function (Default).
         * 1 - Enable antenna detect function.
         * [Data2]:PPS on/off
         * 0 - Disable PPS function.
         * 1 - Enable PPS function (Default).
         * [Data3]:PPS output timing
         * 0 - Always output PPS (Default).
         * 1 - Only output PPS when GPS position is fixed.
         * [Data4]:PPS pulse width
         * 1~16367999: 61 ns~(61x 16367999) ns (Default = 69)
         *
         * The documentation does not give the units of the data field.
         * Andy Walls <address@hidden> says:
         *
         * "The best I can figure using an oscilloscope, is that it is
         * in units of 16.368000 MHz clock cycles.  It may be
         * different for any other unit other than the Trimble
         * Condor. 69 cycles / 16368000 cycles/sec = 4.216 microseconds
         * [which is the pulse width I have observed]"
         *

         * Support for this theory comes from the fact that crystal
         * TXCOs with a 16.368MHZ period are commonly available from
         * multiple vendors.  Furthermore, 61*69 = 4209, which is
         * close to the observed cycle time and suggests that the
         * documentation is trying to indicate 61ns units.
         *
         * He continues:
         *
         * "I chose [127875] because [it] divides 16368000 nicely and the
         * pulse width is close to 1/100th of a second.  Any number
         * the user wants to use would be fine.  127875 cycles /
         * 16368000 cycles/second = 1/128 seconds = 7.8125
         * milliseconds"
         */
        if (atoi(field[5]) < 127875)
            nmea_send(session, "$PMTK324,0,0,1,0,127875");
        return ONLINE_SET;

In a situation like this, the comment is as important, or *more*
important, than the code.  It means that in the future, if we 
find an MTK or Trimble that doesn't respond to this incantation,
we can at least try to dig up its spec sheet, find out its
TCXO frequency, and dispatch to a better magic number.
-- 
                <a href="http://www.catb.org/~esr/";>Eric S. Raymond</a>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]