<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPC MicrocontrollersのトピックRe: Which technique is good to measure frequency, GPIO or ADC</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Which-technique-is-good-to-measure-frequency-GPIO-or-ADC/m-p/520798#M3821</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by arw on Thu Sep 12 10:26:56 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello Sukruth,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The simplest method should be to use a timer input/capture, or digital input with edge-triggered interrupts and an internal timer.&amp;nbsp; At 200Hz you have plenty of CPU processing time to handle the interrupt and read+reset a counter.&amp;nbsp; You can have reasonable accuracy with this method if the input waveform is well-behaved and passes the schmitt trigger nicely.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Analog can be very accurate, but requires CPU processing since you will be frequently measuring the input voltage and performing signal processing to arrive at a frequency.&amp;nbsp; It's expensive in CPU time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Allen&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:47:22 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T17:47:22Z</dc:date>
    <item>
      <title>Which technique is good to measure frequency, GPIO or ADC</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Which-technique-is-good-to-measure-frequency-GPIO-or-ADC/m-p/520797#M3820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Sukruth on Thu Sep 12 04:30:15 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to measure input sine wave frequency (~ 200Hz),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;could you kindly comment on the better technique in terms of speed, accuracy, pros and cons for,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. use GPIO interrupt with&amp;nbsp; external schmitt trigger &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;OR&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2.Directly use ADC to count the frequency.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:47:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Which-technique-is-good-to-measure-frequency-GPIO-or-ADC/m-p/520797#M3820</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: Which technique is good to measure frequency, GPIO or ADC</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Which-technique-is-good-to-measure-frequency-GPIO-or-ADC/m-p/520798#M3821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by arw on Thu Sep 12 10:26:56 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello Sukruth,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The simplest method should be to use a timer input/capture, or digital input with edge-triggered interrupts and an internal timer.&amp;nbsp; At 200Hz you have plenty of CPU processing time to handle the interrupt and read+reset a counter.&amp;nbsp; You can have reasonable accuracy with this method if the input waveform is well-behaved and passes the schmitt trigger nicely.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Analog can be very accurate, but requires CPU processing since you will be frequently measuring the input voltage and performing signal processing to arrive at a frequency.&amp;nbsp; It's expensive in CPU time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Allen&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:47:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Which-technique-is-good-to-measure-frequency-GPIO-or-ADC/m-p/520798#M3821</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Which technique is good to measure frequency, GPIO or ADC</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Which-technique-is-good-to-measure-frequency-GPIO-or-ADC/m-p/520799#M3822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Sukruth on Thu Sep 12 21:25:44 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello Allen,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the info,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; just one more small help,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;could you kindly help/direct me with a sample code I can use to capture-compare register to capture the timer value on pin input edges.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sorry I'm new to this,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sukruth&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:47:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Which-technique-is-good-to-measure-frequency-GPIO-or-ADC/m-p/520799#M3822</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Which technique is good to measure frequency, GPIO or ADC</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Which-technique-is-good-to-measure-frequency-GPIO-or-ADC/m-p/520800#M3823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by arw on Sun Sep 15 19:48:58 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello Sukruth,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Since 200Hz is a long time interval for using a capture input with dedicated timer, you might just use software in an interval timer, and use the edge interrupt to read your software counter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;Please look at the examples for RITimer and ExtINT in the MCB1700 example code bundle (&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Fsystem%2Ffiles%2Fmcb1700.code_.bundle.lpc1769.lpcxpresso.zip" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/system/files/mcb1700.code_.bundle.lpc1769.lpcxpresso.zip&lt;/A&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Set the interval time of RITimer interrupt to be at least 10x faster than your input signal.&amp;nbsp; Increment a software counter in the interrupt service routine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Configure the external interrupt to detect the rising/falling edge of the input waveform.&amp;nbsp; In the interrupt service routine, read your software counter and check it is in the desired range.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the accuracy of this method is not enough, you can increase the interval time of RITimer or change to a real capture interrupt with hardware timer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-allen&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:47:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Which-technique-is-good-to-measure-frequency-GPIO-or-ADC/m-p/520800#M3823</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:47:23Z</dc:date>
    </item>
  </channel>
</rss>

