Home \ Help \ Search \ Login RSS

Welcome, Guest. Please Login

This forum is now READ-ONLY! Please visit http://forum.wiring.co/ for the new forum.

Wiring ForumProgramming Questions & HelpSyntax › delayMicroseconds max and roll over problem

Page Index Toggle Pages: 1
delayMicroseconds max and roll over problem (Read 9662 times)
03/29/11 at 04:51:15

Zap   Offline
YaBB Newbies
Tnks Zap
Ausi

Posts: 22
*
 
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.
 

IP Logged
 
Reply #1 - 03/29/11 at 23:39:41

Vaccumdiode2   Offline
Full Member
chicago, IL USA

Posts: 120
***
 

Zap.

       Did you see this?

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

Vaccumdiode Smiley
 
IP Logged
 
Reply #2 - 03/30/11 at 05:33:06

Zap   Offline
YaBB Newbies
Tnks Zap
Ausi

Posts: 22
*
 
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.

 

IP Logged
 
Reply #3 - 03/30/11 at 07:48:55

mowcius   Offline
YaBB Newbies
North Yorkshire, UK

Posts: 17
*
 
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.
 

IP Logged
 
Reply #4 - 03/30/11 at 15:42:08

Vaccumdiode2   Offline
Full Member
chicago, IL USA

Posts: 120
***
 
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
 
IP Logged
 
Reply #5 - 03/30/11 at 22:04:31

Zap   Offline
YaBB Newbies
Tnks Zap
Ausi

Posts: 22
*
 
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.
 

IP Logged
 
Reply #6 - 03/31/11 at 07:45:36

mowcius   Offline
YaBB Newbies
North Yorkshire, UK

Posts: 17
*
 
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  Wink
 

IP Logged
 
Reply #7 - 04/01/11 at 03:35:17

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
It will be on the next reference update, thank you all for pointing it out.
 
IP Logged
 
Page Index Toggle Pages: 1