Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Timer is not accurate when the time set below 1ms #55

Open
denieldeniel opened this issue Nov 28, 2016 · 1 comment
Open

Timer is not accurate when the time set below 1ms #55

denieldeniel opened this issue Nov 28, 2016 · 1 comment

Comments

@denieldeniel
Copy link

when time set below 1ms , time is not accurate
timer set actual ouput
1000ms 1080ms
0.9ms 1014ms
0.8ms 0.84ms
0.5ms 0.7ms
0.1ms 0.2ms

This My test script . It is a PWN Wave.
#include <DueTimer.h>
#include "variant.h"
int Pump1=11;
int Pump1_High_Time=100;
int Pump1_Low_Time=100;

void ontime_pump_high(){
digitalWrite(Pump1, HIGH);
Timer4.stop();
Timer4.attachInterrupt(ontime_pump_low);
Timer4.start(Pump1_High_Time);
}

void ontime_pump_low(){
digitalWrite(Pump1, LOW);
Timer4.stop();
Timer4.attachInterrupt(ontime_pump_high);
Timer4.start(Pump1_Low_Time);

}

void setup() {
// put your setup code here, to run once:
pinMode(Pump1, OUTPUT);
digitalWrite(Pump1, LOW);
Timer4.attachInterrupt(ontime_pump_high);
Timer4.start(10*1000) ;
}

void loop() {
// put your main code here, to run repeatedly:

}

@ivanseidel
Copy link
Owner

#56 should have fixed it. Can you run the tests again to check?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants