Hi there
Im using the DUE timer library to count an Event with a certain frequency in (Hz) from 0-100 Hz
I figured out that my frequency output is true till about 40 Hz and then I dont get the right frequency
I used the DueTimer.h Library
Can anyone tell me where is the bug in my code ?
I controlled my output frequncies with an oscilscope
#include <DueTimer.h>// Arduino DUE timer
unsigned int Frequenz=20 ;//Desiered output Frequency
void handler()// Interruptshandler
{ // I removed the other programm codes which are irrelevant to my question
}
void setup() {
// put your setup code here, to run once:
Timer4.attachInterrupt(handler);
Timer4.setFrequency(Frequenz*66);// Here is where I set a certian Frequency as output
Timer4.start();
}
void loop() {
// put your main code here, to run repeatedly:
}