Hi,
The timer 1 will work to at least 15MHz, more than enough for your application.
My code will also work, just adjust the counting time, variable ctime in my code, to suit the frequency range. Use pauseus instead of pause for very short counting times.Setting ctime to 100 and changing the pause command to pauseus will give a reading up to 6.5535MHz with 100Hz resolution (100us count time). The 100Hz resolution is better thn .05% at 300KHz, much more than you need for a typical LCR meter.
An external prescaler is not required, you don't even need to use timer1's internal prescaler.
Regards,
Robert G8RPI.




Bookmarks