CHAPTER FIVE
5-2
bc620/627AT Time and Frequency Processor
Symmetricom, Inc.
5.2 EXTERNAL EVENT TIME CAPTURE
This example sets up the TFP event capture to occur on a rising edge. The time capture lockout
mechanism is also used.
/* Initialize TFP Event Hardware */
outportb(PAGE, 0x01);
/* Switch to PAGE1 */
outportb(CR0, 0x09);
/* enable event and lockout */
outportb(INTSTAT, 0x01);
/* clear event INTSTAT bit */
/* Wait for Event and Process Data */
while(!(inportb(INTSTAT) & 0x01));
/* wait for event to occur
*/
for(i=0; i<9; i++)
/* read event time
*/
time[i] = inportb(i);
dummy = inportb(BASE+0x0A);
/* release capture lockout
*/
outportb(INTSTAT, 0x01);
/* clear event INTSTAT 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 1pps epoch.
void send_packet(char *charptr)
{
outportb(FIFO, SOH );
while(*charptr) outportb(FIFO, *+ );
/* load body of packet
*/
outportb(FIFO, ETB);
outportb(ACK, 0x81);
/* command TFP & clear ACK */
while(!(inportb(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 */
outportb(INTSTAT, 0x08);
/* clear INTSTAT 1 PPS bit */
while(!(inportb(INTSTAT) & 0x08));
/* wait for 1 PPS */
send_packet("B123112233");
/* set the days thru seconds */
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com