- Fri Mar 03, 2006 8:58 am
#10641
hi all
code snippet give on SFE site to measure pulse width of Adxl202 is like
for(x = 0 ; x < 10 ; x++)
{
cx = 0;
while(XPWM == 1); //Wait for current Pulse to end
while(XPWM == 0);
while(XPWM == 1) cx++;
counter_x += cx;
}
My question is: are we measuring the whole pulse(T2) width coz we r increasing counter when XPWM is again 1. that means whole pulse not only the ON period (T1)of the pulse, which we want to calculate.As far as i know T2 is determined by Rset.
what if we want to measure just ON (T1) portion of the pulse
any help would be appriciated...
code snippet give on SFE site to measure pulse width of Adxl202 is like
for(x = 0 ; x < 10 ; x++)
{
cx = 0;
while(XPWM == 1); //Wait for current Pulse to end
while(XPWM == 0);
while(XPWM == 1) cx++;
counter_x += cx;
}
My question is: are we measuring the whole pulse(T2) width coz we r increasing counter when XPWM is again 1. that means whole pulse not only the ON period (T1)of the pulse, which we want to calculate.As far as i know T2 is determined by Rset.
what if we want to measure just ON (T1) portion of the pulse
any help would be appriciated...