/* INITIALIZE TFP EVENT HARDWARE */
*CMD = 0x09 ;
*VECTOR = 0x40 ;
*LEVEL = 0x03 ;
*INSTAT = Ox01 ;
*MASK = 0x01 ;
/ * enable event and lockout */
/ * interrupt vector */
/ * interrupt level set */
/ * clear INSTAT bit */
/ * enable the interrupt */
/* INTERRUPT SERVICE ROUTINE FRAGMENT */
readptr = EVEIVTO ;
for(i=0 ; i<5 ; i++) time[i] = *+;
dummy = *UNLOCK ;
/
*
release capture lockout */
*INTSTAT = Ox01 ;
/
*
clear INSTAT bit */
5.3 PROGRAM PERIODIC FREQUENCY OF 1000 HZ
This example uses a generalized send packet() function to program a 1000 Hz output periodic
synchronized to the TFP 1 PPS epoch.
#define ACK ( s h o r t * ) ( B A S E + 0 x 2 2 )
void sendfiacket(char *charptr)
*FIFO = SOH ;
while(*charptr) *FIFO = *+ ;
*FIFO = ETB ;
*ACK = 0x81 ;
while( (*ACK & 0x01)) ;
/* load body of packet */
/ * command TFP & clear ACK */
/* 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 runnning mode and sets the TFP major time. Using the 'B' packet.
sendpacket("A1') ;
*INSTAT = 0x08 ;
while(!(*INSTAT & 0x08) ;
send_packet("B123112233') ;
/* select mode 1 * /
/* clear INSTAT 1PPS bit */
/* wait for 1PPS */
/* set the days thru seconds */
5-2 b c 6 3 5 V M E / b c 3 5 0 V X I Manual
Datum Inc., Bancomm Div.