ivanseidel / ivanseidel/DueTimer

Timer is not accurate when the time set below 1ms

Open
#55 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
217
Forks
87
PR merge metrics
No merged PRs in 30d

Description

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
#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:

}

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting the DueTimer.h API and the Timer4 start/attachInterrupt usage shown in the report, including the relationship between the requested values and the observed outputs. Reproduce the timing measurements for values below 1ms and for 1000ms; done means the timer behavior is accurate or its supported resolution and limitations are clearly established.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino, cpp
Domain
embedded-iot, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.