KPL wrote: > For now, I am looking for some description about frequency measuring. I > see a lot of PIC-based F counters with asm code, but that code usually > is overloaded with display management and other stuff so are quite hard > to understand. Do anybody know any reference where I could read some > good description _how_ to do that. Don't know, but this might help you... Basically, you compare the frequency to measure with a known frequency (which usually is the processor's clock). There are two main ways. One is to count how many cycles of the frequency to measure fall within a known time; for example one second. You can use e.g. the timer 1 in counter mode for this. This method is generally used when the measuring time is (or may be) long compared to the cycle time. The other method is to count how many cycles of the known frequency fall within a single cycle (or a known multiple of a single cycle) of the frequency to measure. You can use e.g. the CCP module in capture mode for this. This is generally used when the frequency to measure is low compared to the known frequency. Which method you choose depends on the frequencies you're looking at, on the precision and timing requirements, on the available hardware resources -- and on personal taste :) Sometimes you may want to switch between methods based on a preliminary first result. Gerhard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist