What about detecting the / edge with the capture int, but don't bother time check/subtract etc. When you capture a / edge, simply load one of the timers to 50uS (between your 2 pulse widths) and when that timer int occurs all you need to do is check the input, which will give 0 for 25uS pulse and 1 for a 75uS pulse. You don't need to do any period measurement and it's very low in cycles. ;o) -Roman Scott Dattalo wrote: > My bit stream is a little different. Instead of Manchester encoding, my > stream is On/Off encoding. Manchester is better. As I said before, the > pulse stream is ~10kHz. The width of the pulse dictates 0's and 1's. At > 10kHz, the pulses are coming in at a rate of 1 every 100 uS. 25uS wide > pulses are zeroes and 75uS wide ones are ones. > I decided to use the CCP module instead of a polling interrupt. I first > program the CCP module to capture every rising edge. When I capture a > rising I subtract from that the time I captured for the last rising edge. > This gives the time between rising edges and should be about 100uS. After > a rising edge is captured, I reprogram the CCP module to capture every > falling edge. When I capture one I subtract from it the time of the last > captured rising edge. This gives the pulse width. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body