Content originally posted in LPCWare by elef on Sun Jul 15 05:49:32 MST 2012
Quote: ranaya
Hi all......
Im looking for a code example or an explanation for a frequency counter (up to 100MHz) and to measure pulse width using LPC1769. Can I use the capture modules for this ? Is there any application note for this ?
Thank You
From what i can tell, the LPC1769 is not suitable. Firstly, the capture can no way get anywhere near 100MHz (i reckon you would even struggle to get 5to 10MHz, but that's just guessing). Secondly, you could use the timer in "counter" mode, but you will be limited to 1/4 CCLK because the timer is not asynchronous, so assuming you are running the LPC at 100MHz, that's 25MHz. And it has other limitations, like duty cycle. My suggestion, give it a miss.
You need a different MCU which has an asynchronous timer/counter. Or better still you could build a 100MHz counter into your front end interface circuitry, that way you can use any MCU (such as LPC1769), that would work. Either way, it will be far more accurate than what the LPC1769 can measure in either capture or counter mode. The other advantage with an external counter, you can just replace the IC, and change a few values in your firmware, and you can straight away go from 100MHz, to 200Mhz, 500Mhz, 1GHZ, 2GHz etc... for very little extra cost.