PDA

View Full Version : Time between interupts



modifyit
- 27th April 2006, 15:40
I'm looking for a creative solution or any ideas for a method of measuring the time between to rising edge interrupts using only pin B0 of an 877a chip.

I've basically got an external PWM signal that I am monitoring using a B0 pin interupt using the "Instant Interrupts" that Daryl created (Great by the way). The interupt is triggered on the rising edge and processes a small subroutine before exiting the interrupt. After exiting the interupt the PIC processes other code while it looks for the next rising interupt. The interupt and subroutine work great, but I need to know how often the interrupt occurs.

I have not tried this yet, but I was thinking of using the COUNT command to count the number of pulses over a certain period of time, but I am not sure if the COUNT command will work and not be effected by the interrupt.

I apreciate any input.

paul borgmeier
- 27th April 2006, 15:48
If you like Darrel's Instant Interrupts, you also might want to try his routines to measure time between events. His post for that is here

http://www.picbasic.co.uk/forum/showthread.php?t=365

If your time is going to be greater than 2^16 instruction, you may need to modify his code to count overflows.

Paul Borgmeier
Salt Lake City, Utah
USA

modifyit
- 27th April 2006, 18:02
Thats pretty sweet, I'll have to see if I can get that one to work. It sounds like it will do exactly what I need and much more accurately.