Skip to content

micros() is going backwards #4

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
danieleff opened this issue May 30, 2017 · 2 comments
Closed

micros() is going backwards #4

danieleff opened this issue May 30, 2017 · 2 comments
Labels
bug 🐛 Something isn't working

Comments

@danieleff
Copy link

version 2017.5.12

Serial.println(micros());
Serial.println(micros());
Serial.println(micros());

result:

2001996
2001965
2001939

expected: numbers going up

@ghost ghost self-assigned this May 30, 2017
@ghost ghost added the bug 🐛 Something isn't working label May 30, 2017
@fpistm fpistm closed this as completed in 61924cc May 30, 2017
@fpistm
Copy link
Member

fpistm commented May 30, 2017

correction tested with:

void setup() {
  Serial.begin(9600);

  while (!Serial);
  Serial.println(micros());
  Serial.println(micros());
  Serial.println(micros());
  Serial.println(micros());
  Serial.println(micros());
  delay(1);
  Serial.println(micros()); 
  delay(10);
  Serial.println(micros());
  delay(100);
  Serial.println(micros());
  delay(1000);
  Serial.println(micros());
  delay(1);
  Serial.println(micros());
  delay(10);
  Serial.println(micros());  
  delay(100);
  Serial.println(micros());
  delay(1000);
  Serial.println(micros());
  delay(10000);
  Serial.println(micros());
  delay(1);
  Serial.println(micros());
  delay(10);
  Serial.println(micros());  
  delay(100);
  Serial.println(micros());
  delay(1000);
  Serial.println(micros());
  delay(1);
  Serial.println(micros());  
}

result:

micros          delta (µs)     delta (ms)
1028
1051            23	
1070            19	
1090            20	
1109            19	
2001            892           0,892
12001           10000         10
112001          100000        100
1112001         1000000       1000
1113001         1000          1
1123001         10000         10
1223001         100000        100
2223001         1000000       1000
12223001        10000000      10000
12224001        1000          1
12234001        10000         10
12334001        100000        100
13334001        1000000       1000
13335001        1000          1

@fpistm fpistm reopened this Jun 4, 2017
@fpistm
Copy link
Member

fpistm commented Jun 4, 2017

Issue not fully fixed:
http://www.stm32duino.com/viewtopic.php?f=51&t=2020&start=10#p27101
Thanks Pito

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants