Here is my interrupt routine to measure the input pulses from a vehicle speed sensor. How long does this routine take to process? At 65 mph it receives 65 pulses in 0.350 seconds. At what input frequency does it begin to miss input pulses?
Code:
interrupt: if toflag = 1 then 'check if interrupt was caused by toflag. settimer off 'turn off timer mph = w15 'load w15 to MPH let w15 = 0 'clear w15 value to zero let toflag = 0 'clear over flow flag elseif w15 = 0 then 'on first hardware input w15 will still be zero inc w15 'increment w15 let hint1flag = 0 'clear hardware flag let timer = 65535 'preloads timer to overflow and set toflag when minor ticks finish counting settimer 54535 'enable timer 0.352 seconds else inc w15 'increment w15 let hint1flag = 0 'clear hardware flag endif setintflags or %10000010, %10000010 'hardware interrupt INT1, Timer over flow flag return