My goal is to use timer0 to refresh the 7 segment displays, and use timer1 free running so i can count the pulses from portb.7 so i think setting interrupts for timer1 won't be nedded. The part that captures TMR1L and calculates RPM, is the one that is giving me problems.
with your t1con setting the max period for TMR1 is 524.295 mSec : not enough
tmr1 is 16 bits just reading TMR1L will not work.
if you leave tmr1 free running you need to read ITS 16 bit value at "say the leading edge " of the timing pulse
then read the timer again at the next "leading edge" and calculate the difference (maybe check and clear the overflow also).or start the timer on "say the leading edge " and stop it on the next . either way you need to sync up with the timing pulse
the other way is to count the timing pulses over a fixed timebase , in this case you would need some tens of seconds to get meaningfull results.
Can you explain me better the part of tho orphaned code?
the isr returns to the main loop after the RESUME /ENABLE
any code after that will never run ever
From what i have read, and correct me if i'm wrong, since i'm trying to aquire a signal near 0.625hz, those command won't serve my purposes.
correct , can you modify the machine to get 2 pulses per rev ?
Bookmarks