No, Nick Gammon does not say that.
It says that the measured pulse width by the Arduino is 100ns accurate. Testing shows that the displayed pulse width is within 100 ns of the actual width (two clock cycles basically) which isn’t too bad.
How accurate do you want to measure that pulse width ?
How often does that pulse occur ?
I think you need extra hardware.
in that they said they measure 100 nano Second pulse width. i tried it but not able to measure Pulse width less than 10 Microseconds.
Kindly help me.
The only way I see you being able to measure sub microseconds pulses is to:
Build some hardware
Create a high frequency clock source.
Create a logic circuit that counts those clock pulses while your observational window is open
Then read the stored count.
repurpose one of the Timer/Counter modules
Using the internal hardware of the UNO, the max you can measure is timer_clock (CLKi/o) / 2.5.
So, with a 16mhz crystal, the minimum pulse period you could supply to T0 (D4) would be 6.4MHz or 0.15625 Microseconds. see AVR205 app note:
Realistically you are going to have to build some hardware to measure sub microsecond signals.
while (PINB & 1 == 0)
; // wait for a high pulse
if ((PINB & 1) == 0) // low again?
if ((PINB & 1) == 0) // NOW is low?
if ((PINB & 1) == 0) // how about now?
if ((PINB & 1) == 0) // other things are waiting!
if ((PINB & 1) == 0) // tap tap tap.
if ((PINB & 1) == 0) // I've justa about had it!
if ((PINB & 1) == 0) // I really mean it!
if ((PINB & 1) == 0) // Last chance
return -1; // We are SO done...
This compiles (for low-address ports), to a series of SBIS/RJMP pairs that the avr ought to run through at two cycles each, which should give accuracy on the order of 125ns...
It will, of course, require adequate time "between" pulses to to the returns and process the results, you might need to do some tuning of the values returned, and perhaps it could use extending and a lot of testing to make sure it's close...
I think this is about as good as you can do on an AVR; you can't start a timer any more quickly than this will enter its string of instructions...