Using an external clock to drive CDP (Common Data Packet) time stamps for BC, RT, or BM is a relatively easy process.
The ADT_L1_Global_ConfigExtClk function described in the AltaAPI Users Manual is used to specify clock type (TTL or RS485 differential), INPPU or OUTPUT, and FREQUENCY (1, 5, or 10 MHz).
The function call is:
ADT_L1_Global_ConfigExtClk (devID, clkFreq, clkSrcIn, clkSrcOut)
where the parameters are:
ADT_L0_UINT32 devID = DEVICE ID
ADT_L0_UINT32 clkFreq = 1,5, or 10 (Mhz rate)
ADT_L0_UINT32 clkSrcIn = 1 for RS485, 2 for TTL (other = NONE)
ADT_L0_UINT32 clkSrcOut = 1 for RS485, 2 for TTL (other = NONE)
For example, to use an external 5MHz TTL clock as an input, the call would be
ADT_L1_Global_ConfigExtClk(DEVID, 5, 2, 0)
To generate a TTL 5MHz output, the call would be
ADT_L1_Global_ConfigExtClk(DEVID, 5, 0, 2)
The example file ADT_L1_1553_ex_ExtClk.c shows usage and configuration of the external clock using a 485 source. Also note that in addition to the ADT_L1_Global_ConfigExtClk function to configure the external clock, a call must be made to ADT_L1_1553_UseExtClk() to enable the channel specified in the DEVID to use the external clock. This can be seen in the example program as well, and the parameters for this call are:
ADT_L1_1553_UseExtClk(DEVID, useExtClk, clkFreq), where
useExtClk = 1 for enable, 0 for disable
clkFreq = 1,5, or 10 representing the same frequencies as in the ADT_L1_Global_ConfigExtClk function call.