PROGRAMMING EXAMPLES
Symmetricom Inc
bc635VME/350VXI Time and Frequency Processor (Rev. E)
5-3
5.3 PROGRAM PERIODIC FREQUENCY OF 1,000 HZ
This example uses a generalized send_packet( ) function to program a 1,000 Hz output periodic
synchronized to the TFP 1pps epoch.
#define ACK
(short*)(BASE+0x22)
void send_packet(char *charptr)
{
*FIFO = SOH ;
while(*charptr) *FIFO = *+ ;
/* load body of packet */
*FIFO = ETB ;
*ACK = 0x81 ;
/* command TFP & clear ACK */
while(!(*ACK & 0x01)) ;
/* wait for TFP acknowledge */
}
/* CODE FRAGMENT WHICH SETS PERIODIC */
send_packet("F500630063") ;
/* 0x0063 = 99 = (100-1) */
5.4 SET MODE 1 AND THE MAJOR TIME
This example selects the free running mode and sets the TFP major time, using the “B” packet.
send_packet("A1") ;
/* select mode 1 */
*INSTAT = 0x08 ;
/* clear INSTAT 1pps bit */
while(!(*INSTAT & 0x08) ;
/* wait for 1pps */
send_packet("B123112233") ;
/* set the days through seconds */
5.5 SELECT MODE 0 (IRIGB) AND ADVANCE TFP 2.5 MILLISECONDS
The following code fragment selects the mode, timecode, and offset. The last “P" packet is used
to disable jamsynchs since the required offset is larger than 990 microseconds. See the “G”
packet description for additional details on the jamsynch function.
send_packet("A0") ;
/* select mode 0 */
send_packet("HB") ;
/* select IRIGB timecode */
send_packet("G+0025000") ;
/* advance 2.5 milliseconds */
send_packet("P04") ;
/* disable jamsynchs */
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com