how to give delay of 1 nano seconds

Is their any operation which takes time less than nop so we can give delay of 1ns. Actually I want to use it to calculate time in pure nanoseconds required for the execution of particular process or sketch. Also I want to implement in laser range finder so if someone knows the answer so please tell me. ::slight_smile: ::slight_smile: ::slight_smile:

Not possible. With a 16MHz crystal or resonator, the best you can hope for is one clock cycle - 62.5nS.

The unit of time of your microprocessor is based on its frequency… At 16MHz you don’t get nano second granularity - so you need a faster processor.

Is their any operation which takes time less than nop

Not in any digital processor I know. There are processors where anopneeds less than a nanosecond. They are not called "Arduino", though.

J-M-L:
The unit of time of your microprocessor is based on its frequency… At 16MHz you don’t get nano second granularity - so you need a faster processor.

Or just an additional bit of hardware that only does the timing. 1 nHz timing resolution requires a 1GHz clock, and I can’t imaging that being easy to find in hobby-level micro-controllers. A 1GHz CPU would be stupidly huge overkill for a rangefinder too when you just need it for timing.

Range-finding of course isn’t just a matter of sending out the pulse and waiting for the echo. Like most signal-processing tasks, it can be messy.This post on precisionrifleblog looks like it has a decent discussion of the problems that a rangefinder must take into account. One thing it misses I think is distinguishing your laser from the normal fluctuations of background light. IR remote controls do this by modulating their signal with 38 kHz so it can be band-pass filtered.

And typical laser pointer diodes can't be modulated meaningfully iirc. I have a proper laser rangefinder, I'm not sure if the visible red laser is actually used for measurement or just for aiming.

Jiggy-Ninja: 1 nHz timing resolution requires a 1GHz clock

Don't be silly - 1nHz is one cycle every 31 years eight and-a-half months. It's not a crystal you need, it's a calendar.

AWOL:

1 nHz timing resolution requires a 1GHz clock

Don’t be silly - 1nHz is one cycle every 31 years eight and-a-half months.
It’s not a crystal you need, it’s a calendar.

It took me a while before the laugh emerged :slight_smile:

In any case to get a calculated time measured to +/- 1 nS ns I reckon you would need a 4GHz or maybe 10GHz clock. Almost certainly the OP can’t afford the oscilloscope that would allow him to verify his timing.

…R

Robin2: Don't be silly - 1nHz is one cycle every 31 years eight and-a-half months. It's not a crystal you need, it's a calendar.

It took me a while before the laugh emerged :)

In any case to get a calculated time measured to +/- 1 nS I reckon you would need a 4GHz or maybe 10GHz clock. Almost certainly the OP can't afford the oscilloscope that would allow him to verify his timing.

...R

nS is not nanoseconds, it is nanosiemens. That doesn't need a calendar, it needs a family planning clinic.

Only if one spends a lot of time on top of ohms

Jiggy-Ninja: it needs a family planning clinic.

Very droll.

I will modify my Reply with a smaller insertion.

Note that calendars are also used for family planning.

...R

Robin2:
Note that calendars are also used for family planning.

…R

Not for that kind of problem they aren’t.

Huh - nanosecond is ns, not nS.

Smallest to Largest that we deal with:
A nanosecond (ns) is a SI unit of time equal to one billionth of a second
A microsecond is an SI unit of time equal to one millionth (0.000001 or 10−6 or 1/1,000,000) of a second. Its symbol is μs.
A millisecond (from milli- and second; symbol: ms)
The second (symbol: s) (abbreviated s or sec) is the base unit of time in the International System of Units (SI).[

CrossRoads: Huh - nanosecond is ns, not nS.

I did acknowledge my indiscretion :)

...R

Back to the original question...

if you can find a counter that has enough bits, and a clock to drive it at some (Nyquist) multiple of your target measurement frequency, you can 'start' or reset the counter at the first trigger point, and stop it at the second trigger event.

The count value is the number of clock cycles you're measuring.

This clock-counter will be a lot cheaper, and easier to find than your multi-GHz pretty censor.

multi-GHz pretty censor.

Is that someone who edits other peoples' letters at high speed, or a thing for spreading incense really quickly? I always get those two confused.

Both try to avoid an unpleasant stink :)

...R

'processor' + fingers + tablet + autocorrrect = 'pretty censor' :-*

Ramaswami: Actually I want to use it to calculate time in pure nanoseconds

I have more of a fetish for the dirty ones. I don't think I am in a position to give advice.

A microprocessor won't do this job. You need some electronics. You will need to hook a crystal up to a counter chip and count the pulses between the trigger and the return signal. The arduino can trigger the mechanism and read the result off the counter chip. Your sketch would fire off a train of several of these events, and would average, filter, convert and display the results.