Wiring Forum
http://wiring.org.co/cgi-bin/yabb/YaBB.pl
Programming Questions & Help >> Syntax >> delayMicroseconds max and roll over problem
http://wiring.org.co/cgi-bin/yabb/YaBB.pl?num=1301374275

Message started by Zap on 03/29/11 at 04:51:15

Title: delayMicroseconds max and roll over problem
Post by Zap on 03/29/11 at 04:51:15
Can any one tell me the max figure for delayMicroseconds() is?

If I input any number greater that 16384 (14 bit) it seems to roll over and run the delay - 16384.

Am I doing something wrong or is there some documentation on it?

Thanks Zap.

Title: Re: delayMicroseconds max and roll over problem
Post by Vaccumdiode2 on 03/29/11 at 23:39:41

Zap.

       Did you see this?

http://wiring.org.co/reference/delayMicroseconds_.html

Vaccumdiode :)

Title: Re: delayMicroseconds max and roll over problem
Post by Zap on 03/30/11 at 05:33:06
Yeah, I read that but it doesn't mention anything about any upper time limit or 'roll over' limit of the delayMicroseconds function.
I'm trying to do some (accurate) variable timing from 1.875ms to 50ms but when I get over 12.3 ms it seems to start again from the min us.

Zap.


Title: Re: delayMicroseconds max and roll over problem
Post by mowcius on 03/30/11 at 07:48:55
http://arduino.cc/en/Reference/DelayMicroseconds
Well it's unusual for Arduino to have a better reference writeup.

Looks like currently 16383 is the highest you can reliably use.

Title: Re: delayMicroseconds max and roll over problem
Post by Vaccumdiode2 on 03/30/11 at 15:42:08
Zap,

        I have used multiable Delay commands to get a timing I needed.


delayMicroseconds(15000);
delayMicroseconds(15000);
delayMicroseconds(5256);

Just an Idea I hope may help you.

Vaccumdiode

Title: Re: delayMicroseconds max and roll over problem
Post by Zap on 03/30/11 at 22:04:31
Vacdiode, Yeah that's how I'm getting around it now with an if greater than 16000 just to make sure.
Thanks mowcius for confirming my suspicions.

Have to get Barragan to put a note in the reference about the max limit.

Zap.

Title: Re: delayMicroseconds max and roll over problem
Post by mowcius on 03/31/11 at 07:45:36

Quote:
Have to get Barragan to put a note in the reference about the max limit.

I'd suggest that Barragan might stick it on his list - I hear he's a bit busy  ;)

Title: Re: delayMicroseconds max and roll over problem
Post by barragan on 04/01/11 at 03:35:17
It will be on the next reference update, thank you all for pointing it out.

Wiring Forum » Powered by YaBB 2.5 AE!
YaBB Forum Software © 2000-2010. All Rights Reserved.