Freqcount library, can it be modded to use a gate input on capture pin 8?

Status
Not open for further replies.

Dr pepper

Member
I wrote a simple program to count frequency, I have a precision ocxo divided down to 1hz, this goes to pin 8 (uno) the capture input, and the frequency to be measured goes to pin 5.
Pin 8 is configured as a capture interrupt, and pin 5 as external clock for timer 1.
It works but I keep getting spurious errors, often 65535 (oxffff) too high.
So I installed pauls FreqCount library, it works but its not very accurate using the uno's built in xtal osc, can the library be modded to use pin8's capture interrupt so I can use my accurate gate signal?, or should I dig further into my existing code.
 
Ok so I found a file used by the compiler - freqcount_timers, this tells the compiler which timer to use depending on the processor being used.
Seems like on the uno timer 2 is used, and they are interrupting on compare A.
To make this work then I need to use timer 1, as thats the only one with a capture interrupt on the uno, and then I need to remove or disable the rest of the code that generates the gate interrupt, I sort of get it so far, getting late so I'll look again tomoz.
 
Status
Not open for further replies.
Back
Top