Closed LieBtrau closed 8 years ago
I've added a slight extra check, just in case we ever have another non-AVR board at 12 MHz. https://github.com/PaulStoffregen/FreqCount/commit/8dbce069a983c8ecb70a9464701e3712ea438428
Ok, I guess you can close this one then.
The ProTrinket 3V runs at 12MHz, so there's no simple factor 2 division possible downto 1KHz for millisecond interval. This leads to Timer2 intervals that are not milliseconds or multiples thereof. The workaround is to correct the count value by multiplying with a floating point correction factor before returning the count value to the user code. I checked the result with a Philips PM6665 Timer/Counter.
Signed-off-by: Christoph Tack prog.send@gmail.com