Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Do you have code about input capture

2005-01-06 by bpesun

I am using 2114,and I want to use input capture to measure the pusle.
but i can't into the interrupt.DOes any people have done that?Can i 
see your code?
the following is my code,but it can/t go to interrupt.
/******************************************
* Ãû³Æ    :  void Timer_Init(void)
* ¹¦ÄÜÃèÊö:  ¶¨Ê±Æ÷0ÖжϷþÎñ³ÌÐò
* ÊäÈë²ÎÁ¿:  ÎÞ
* Êä³ö²ÎÁ¿:  ÎÞ
* µ÷ÓÃ×Ó³Ì:  ÎÞ
* ʹÓ÷½·¨:
--------------¡ª*/
void __irq  IRQ_Timer1(void)
{                                      
   Prints("int");//this is my debug function
   if( (IO0SET&LEDCON) == 0 ) IO0SET = LEDCON;	
      else  IO0CLR = LEDCON;    		 	            
	     
   T1IR = 0x02;	    		
	                      // Çå³ýÖжϱêÖ¾
   VICVectAddr = 0x00;			
	                  // ֪ͨVICÖжϴ¦Àí½áÊø
}



void  Timer1Init(void)
{     
   T1PR = 99;			    		
   T1CCR |= (1<<9);           
   T1CCR |= (1<<10);            //cap1.3ÉÏϽµÑØÌø±ä½«TCÄÚÈÝ×°ÈëCR3
   T1CCR |= (1<<11);            //cap1.3Éϲ¶»ñ×°ÔØ²úÉúÖжÏ
   T1IR|=0x80;                     //Çå³ýÖжϱêÖ¾
   T1TCR = 0x03;		   			
	       T1TCR = 0x01; 
   
   VICIntSelect = 0x00000000;				
		
   VICVectCntl0 = 0x20|5;				
  VICVectAddr0 = (uint32)IRQ_Timer0; 		        

   ICIntEnable = (1<<5);				   
   PINSEL1|=(1<<10);                
   PINSEL1|=(1<<11);                //    

}

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.