Johan Rantala wrote: > Yeah, you're so right ;) > I'm using a 20Mhz external crystal. > > At 20 MHz PIC16F877A you have only 40 instructions per=20 > > 10 microsecond period. > > Not that many for C language. > > Perhaps you should switch to: > > - assembler; > > - PIC18Fxxx; > > - TIP #2 Measuring the Period of a Square Wave _with Averaging_ > So the CCP-module with my PIC16F877A > is out of the question for measuring these kind of periods?=20 > Would it help to use every 16th rising edge? Yes, the mentioned pattern from the mentioned .pdf is called:=20 "TIP #2 Measuring the Period of a Square Wave with Averaging" "Pattern" =E2=80=93 based style of development makes developers speak one language, saves a lot of time. Best Regards, Mike. _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist