Delay quicker then 1 milli

I need a delay in units of 0.1 milliseconds.
Prefer units of 0.01 milliseconds.
Somekind like 'delay' but then
for a time of 46.44 milliseconds.

  • delaymicroseconds(46440); -

delayMicroseconds(46440);

[/nitpicking]

No marks for nitpicking

RTFM

I swear I knew there was something fishy, but just couldn't put my finger on it.

for a time of 46.44 milliseconds.

I am still wondering what on Earth needs exact this delay ?

robtillaart:

for a time of 46.44 milliseconds.

I am still wondering what on Earth needs exact this delay ?

For this http://rudius.net/oz2m/ngnb/index.htm

Great inspiration!!

If you can make such a beacon with Arduino, it should also be possible to make a tsunami warning bacon with Arduino!

robtillaart:
Great inspiration!!

If you can make such a beacon with Arduino, it should also be possible to make a tsunami warning bacon with Arduino!

It is working on an Atmel. I have done here the same at my
home. Include the homebrew equipment http://1drv.ms/1cd3T8O

And there is more like this Ultimate3/3S QRSS/WSPR kit

But all this is only for licensed HAM-radio amateurs

tsunami warning bacon

That would be a pig to debug though :slight_smile:

Shpaget:
delayMicroseconds(46440);

[/nitpicking]

AWOL:
No marks for nitpicking

RTFM

Not quite sure what AWOL was referring to about nitpicking, but 46440 is too long for accurate use according to the documentation:

Currently, the largest value that will produce an accurate delay is 16383.

Maybe combining delay(46); with delayMicroseconds(440);? May need to adjust the number of microseconds to take into account the overhead of execution of commands between the two delay statements? Probably would have to empirically tune it in by hand on the specific hardware you plan on using.

Not quite sure what AWOL was referring to about nitpicking,

Exactly what you wrote - the delay value is too long for a single call to delayMicroseconds, hence the link to the reference page.

Maybe combining delay(46); with delayMicroseconds(440);? May need to adjust the number of microseconds to take into account the overhead of execution of commands between the two delay statements? Probably would have to empirically tune it in by hand on the specific hardware you plan on using.

I have done this, 2 statements and correction over the overhead.
But should be nice when it was in 1 statement. And if someone
it has written already in C :wink:

like this?

void myDelayMicroseconds(unsigned long m)
{
   m = m- correction;
   delay(m/1000);
   delayMicroseconds(m%1000);
}

Or don't use delay(n) at all. Use the micros() counter.

See the sketch "Blink Without Delay" in the Examples of the Arduino IDE.