I am new to the forum. I am recording the RPM, and show it on 4x seven segments with CCP2. It actually works quite well from about 3.81Hz to about 166Hz, which is enough upwards. I measure the frequency based on each rising edge (waiting for a rising edge), thereby calculating the frequency. I do not use an external interrupt. I use Timer1 with Fosc/4 = 2MHz and prescale 8. What gives me problems are the lower frequencies so lower than the 3.81Hz. I tried to count the overruns and determine the correct RPM from that, but unfortunately it doesn't work.
period = ov_cnt * 65536 + Second_Edge - First_Edge
Is there a possibility to increase the Timer1 from 16bit or 19bit or 24bit?
Or is there another possibility to measure and display the lower frequencies?
Or am I doing something wrong?
I work with: MPLAB X IDE v5.50 XC8 v2.32 compiler PIC18F45K22 Pickit3 Programmer/Debugger
I hope you can help me.
Thanks a lot and best regards