CHAPTER FIVE
5-2
bc635VME/bc350VXI Time and Frequency Processor (Rev. E)
Symmetricom Inc
5.2 EXTERNAL EVENT TIME CAPTURE
This example sets up the TFP event capture to occur on a rising edge and generate an interrupt.
The time capture lockout mechanism is also used.
#define EVENT0
(short*)(BASE+0x16)
#define CMD
(short*)(BASE+0x24)
#define VECTOR
(short*)(BASE+0x2C)
#define MASK (short*)
(BASE+0x28)
#define INTSTAT
(short*)(BASE+0x2A)
#define LEVEL
(short*)(BASE+0X2E)
#define UNLOCK
(short*)(BASE+0x20
/* INITIALIZE TFP EVENT HARDWARE */
*CMD = 0x09 ;
/* enable event and lockout */
*VECTOR = 0x40 ;
/* interrupt vector */
*LEVEL = 0x03 ;
/* interrupt level set */
*INSTAT = 0x01 ;
/* clear INSTAT bit */
*MASK = 0x01 ;
/* enable the interrupt */
/* INTERRUPT SERVICE ROUTINE FRAGMENT */
readptr = EVENT0 ;
for(i=0 ; i<5 ; i++) time[i] = *+;
dummy = *UNLOCK ;
/* release capture lockout */
*INTSTAT = 0x01 ;
/* clear INSTAT bit */
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com