frequency meter tmr2 blunder
Posted: Tue Jun 12, 2012 6:35 am
this frequency meter works great, however i discovered something odd--> this only works accuratly with a tmr2 frequency of 1000 hz, for example reading 5khz input the meter reads 5Khz but if i set tmr2 interrupt to 250hz it reads 4988 hz instead,.... so for kicks i tried a 16.384Mhz crystal instead of internal osc for a lower even tmr2 interrupt freq, i tried 1000 hz again and it was spot on, then i tried 62hz tmr2 interrupt frequency, it was 30 hz low at 4970 roughly,......
i would have figured that using a low tmr2 interrupt frequency my interrupt on pin input frequency would have been more accurate than at a high frequency tmr2 interrupt since at a high interrupt speed there is less time to service the interrupt on pin macro, but that theory was proven backwards(why did this happen?) 

