Hi ckshivaram
thanks for help
but now i have the problem of counting the pulse
i have the program as
unsigned long int count;
unsigned int lbyte,hbyte;
P1=0;
T2CON=0x02;
T2MOD=0x01;
TL2 = 0x00; // Timer 2 low byte
TH2 = 0x00; // Timer 2 high byte
RCAP2L = 0x00; // Timer 2 reload capture register, low byte
RCAP2H = 0x00; // Timer 2 reload capture register, high byte
while(1)
{
TR2 = 1;
lbyte=TL1;
hbyte=TH1;
hbyte=hbyte<<8;
count= hbyte | lbyte;
DISPLAY(count);
}
but its not counting the pulses please help..........