DNA/DNR-IRIG-650 IRIG Timing Layer
Chapter 3
19
Programming with the Low Level API
Tel: 508-921-4600
www.ueidaq.com
Vers:
4.6
Date: March 2019
DNx-IRIG-650 Chap3x.fm
© Copyright 2019
United Electronic Industries, Inc.
3.2
Low-level
Programming
Techniques
The IRIG-650 or CT-650 offers a simple API to program most of its functions,
which is described as follows:
•
Time Keeper Programming: shows how to configure the Time Keeper.
•
Input Programming: shows how to configure input time codes and use them
with the Time Decoder.
•
Output programming
•
Assigning TTL outputs
•
Enabling and disabling subsystems
•
Event programming (sync & async): shows how to program the extensive
event generation and recording system of the IRIG-650.
•
GPS programming
•
Calibrating the precision oscillator
•
Custom PLL frequency generation
3.2.1
Time Keeper
Programming
This section shows how to configure, get & set time for the Time Keeper block
described in “Functional Description” on page 6.
3.2.1.1
Configure the
Time Keeper
The time keeper can be configured by calling the function:
ret = DqAdv650ConfigTimekeeper(hd, devn, mode, flags);
For proper functioning, the timekeeper requires a 1PPS signal, which can be
delivered from the following sources, specified in
<mode>
parameter:
1. Internal timebase from the precision oscillator (
CT650_TKPPS_INTERNAL
)
2. 1PPS clock sources derived from input timecode (
CT650_TKPPS_TIME-
CODE
)
3. 1PPS clock source (
CT650_TKPPS_GPS
) derived from integrated GPS
device (while the GPS device always produces 1PPS pulses, user should
read information from GPS device serial port to make sure it has acquired
satellites, it is in active state, and its output is synchronized with the satellite
clock)
4. Externally from one of the TTL input lines (
CT650_TKPPS_IO(N)
), where
N = [0..3]
5. Externally from RF In1 line (
CT650_TKPPS_RFIN
)
6. From one of the SYNCx lines (
CT650_TKPPS_SYNC(N)
), where N = [0..3]
7. Disable timekeeper using
CT650_TKPPS_DISABLED
mode
There are
<flags>
worth mentioning:
1. Use internal timebase to generate 1PPS signal required for timekeeping if
selected external 1PPS source does not deliver pulses (break in timecode
transmission, for example). If the flag
CT650_TKFLG_AUTOFOLLOW
is
selected, timekeeper will switch to internal timebase when an externally
derived one is not available. Note that the Time Keeper is programmed to
recognize a missing 1PPS if it is delayed for more than 50uS of expected
arrival time.
2. Flag
CT650_TKFLG_USENOMINAL
allows user to select whether to use
nominal period (i.e. 100E6 pulses of 100MHz base clock) or the measured