i am useing msp430f4270 controller. i want to calculate external clock so i give this clock as input to 74hc14 smit trigger ic and give its output to p1.5 pin as input. but my timer is not counting pulse correctly................ in input of 74hc14 pulses comes good but in out put pulse is not as good as input to this ic so is there is any problem with pin setting?????? i atteched pin setting snapsot and schemetic diagram here ...i cant attech cro snapshot........
if i give 70,000 pulse its only count 24062..................
here i corrected error regarding ground appear in schematic and now i can debug so problem is of timer........
so sorry its hardware issue my ground is not common now its resolved.......
now timer counts good but now problem is of accuracy..........
if i give it 1000 pulsew with freq=250 its count 1003 and some times 1005
here is code
-----------------------------code--------------------------------
#pragma vector=BASICTIMER_VECTOR
__interrupt void basic_timer(void)
{
cal_flag=1;
if(count==0)
pulse_flag=1;
}
void calculation (void)
{
if(cal_flag==1)
{
pval=cval;
cval=TAR;
cval=TAR;
if(cval != pval)
{
if(cval<pval)
{
pval=0xFFFF-pval;
dif=cval+pval;
}
else
dif=cval-pval;
total2=total2+dif;
n1=1;
}
}
}
void conversion(void)
{
if(n1==1)
{
total=total2%1000000;
n2=1;
n1=0;
}
}
void main(void)
{
WDTCTL = WDTPW + WDTHOLD;
while(1)
{
calculation();
conversion();
output();
}
}
void output(void)
{
if(n2==1)
{
n2=0;
cal_flag=0;
}
}
any suggestion ????????????????