i have given the pulse output from the energy meter to the eZ430-RF2500 kit.... I have slightly modified the temperature sensor demo program of end device to receive the input signal in pin 4.3 and also grounded the gnd pin. my objective is to increment the count value whenever there is a pulse output from the energy meter and display it in sensor monitor in place of the temperature....... but i'm not getting proper readings. (the pulse voltage is around 2-3 volts and there is *** once in 15 seconds) ... the access point program is unchanged and is same as the demo program. Can you tell me where did i go wrong.
P3SEL |= 0x30;
P2SEL &= ~0x04;
P4SEL &= ~0x08;
P2DIR |= BIT2; //Trigger
P4DIR &= ~BIT3; // echo
if((P4IN & 0x08)!=0x08)
{
d++;
__delay_cycles(8000000); //~1 sec delay
}