Scott Dattalo wrote: > On Sun, 23 Feb 2003, Robert Rolf wrote: >> the process. If you are getting captures so quickly you don't have >> time to read both low and high value, aren't you running too close >> to the edge? > > I was mostly speaking hypothetically. My point was simply that *if* > another unexpected event occurs, it will corrupt the reading. But > speaking practically, it's not uncommon to get glitches right around > the transition of an event. In addition, the time when the capture > registers are read can be quite far away from the time the event > actually occurred. The worst case scenario I suppose is when the > event occurs while the code is currently in an interrupt routine. I > could easily see 20 instruction cycles fly by between the event and > the reading of the register. > > Now in my particular case, I'm reading pulses coming off of an RF > receiver. It just so happens that when the RF transmitter (on the > other end) is not transmitting the RF receiver begins hallucinating. > The AGC circuit begins to push the low background noise up to where > it can be seen. This causes erroneous short-lived glitches. When the > RF transmitter is transmitting, there's plenty of signal and the > pulses are nice and fat and easy to read. > > Scott GIGO ;-) Maybe it's time to use a faster crystal? I'm guessing that you are either monitoring an HF sideband signal, or an unsquelched FM receiver. Maybe a DSP audio processor between the radio and the PIC might help to clear things up? Another idea that comes to mind is to immediately disable the Capture upon entry into your subroutine, this should cut the critical area down to around 10 clocks max as opposed to 20. Maybe some more filtering on the input data to eliminate spikes? Without knowing more about the signal you are trying to process, I'm pretty much shooting in the dark, but hey it's the piclist. ;-) Michael Brown Instant Net Solutions www.KillerPCs.net "In the land of the blind, he who has one eye is king" -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.