Hi Since I have been asked to develop code to measure the frequency using XC161 microcontroller. Frankly I don't have any idea of implementing it. However so far I have used the ADC to sample the sine wave of low frequency. Should I use compare and capture module in order to detect the rising edge? (Unless Im talking ***) Your help would be greatly appreicated. AJ
forget the a/d stuff, just (if needed) square the pulse and feed it to a timer if fast, an interrupt of slow. Erik
What is the expected frequency range that you are trying to measure? How accurate do you have to be with the measurement? AN1 is not connected to an alternate function so are you thinking of a purely software method to do it? From your hardware is it possible to connect it in parallel (or buffered) to another port pin of the XC161?