6. Architecture Constants
Following is a list of the important architecture constants that establish the response and stability of the PLL and provide maximum bounds on behavior in order to satisfy correctness assertions made in the protocol specification. Additional definitions are given in the timex.h header file.
6.1. Phase-lock loop (PLL) definitions
The following defines establish the performance envelope of the PLL. They establish the maximum phase error (MAXPHASE), maximum frequency error (MAXFREQ), minimum interval between updates (MINSEC) and maximum interval between updates (MAXSEC). The intent of these bounds is to force the PLL to operate within predefined limits in order to satisfy correctness assertions of the synchronization protocol. An excursion which exceeds these bounds is clamped to the bound and operation proceeds normally. In practice, this can occur only if something has failed or is operating out of tolerance, but otherwise the PLL continues to operate in a stable mode.
MAXPHASE must be set greater than or equal to CLOCK.MAX (128 ms), as defined in the NTP specification. CLOCK.MAX establishes the maximum time offset allowed before the system time is reset,
rather than incrementally adjusted. Here, the maximum offset is clamped to MAXPHASE only in order to prevent overflow errors due to defective programming.
MAXFREQ reflects the manufacturing frequency tolerance of the CPU oscillator plus the maximum slew rate allowed by the protocol. It should be set to at least the intrinsic frequency tolerance of the oscillator plus 100 ppm for vernier frequency adjustments. If the kernel frequency discipline code is installed (PPS_SYNC), the CPU oscillator frequency is disciplined to an external source, presumably with negligible frequency error.
#define MAXPHASE 512000 /* max phase error (us) */
#ifdef PPS_SYNC
#define MAXFREQ 100 /* max frequency error (ppm) */
#else
#define MAXFREQ 200 /* max frequency error (ppm) */
#endif /* PPS_SYNC */
#define MINSEC 16 /* min interval between updates (s)
*/
#define MAXSEC 1200 /* max interval between updates (s)
*/
6.2. Pulse-per-second (PPS) Frequency-lock Loop (FLL) Definitions
The following defines and declarations are used only if a pulse-per-second (PPS) signal is available and connected via a modem-control lead, such as produced by the optional ppsclock feature incorporated in the serial port driver. They establish the design parameters of the frequency-lock loop (FLL) used to discipline the CPU clock oscillator to the PPS oscillator.
PPS_AVG is the averaging constant used to update the FLL from frequency samples measured for each calibration interval. PPS_SHIFT and PPS_SHIFTMAX are the minimum and maximem, respectively, of the calibration interval represented as a power of two. The PPS_DISPINC is the initial increment to pps_disp at each second.
#define PPS_AVG 2 /* pps averaging constant (shift) */
#define PPS_SHIFT 2 /* min interval duration (s) (shift)
*/
#define PPS_SHIFTMAX 6 /* max interval duration (s) (shift)
*/
#define PPS_DISPINC 0 /* dispersion increment (us/s) */
6.3. External Oscillator Definitions
The following definitions and declarations are used only if an external oscillator (HIGHBALL or TPRO) is configured on the system.
#define CLOCK_INTERVAL 30 /* CPU clock update interval (s) */