<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Measure frequency</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19206/measure-frequency</link><description>Hi all, 
 I want to use nRF51822 (s110) to measure the frequency (0 to 5kHz) of a signal connected to an analog input. Other posts ( like this ) show that a good way to implement this is to use a combination of: 
 
 A timer and a counter. The first</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 24 Jan 2017 10:33:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19206/measure-frequency" /><item><title>RE: Measure frequency</title><link>https://devzone.nordicsemi.com/thread/74396?ContentTypeID=1</link><pubDate>Tue, 24 Jan 2017 10:33:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:984f9b7c-df02-4864-b2d3-cad79a62a366</guid><dc:creator>dblasco</dc:creator><description>&lt;p&gt;Design is done using nRF51822 so I would like to stay with this. The first solution you tell me I think it would full quite fast the RAM capacity as you suggest...
I don&amp;#39;t understand the second solution. You mean to generate an interrupt when the threshold is passed and the get the actual timer value?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Measure frequency</title><link>https://devzone.nordicsemi.com/thread/74395?ContentTypeID=1</link><pubDate>Tue, 24 Jan 2017 10:27:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29cc3a4f-b41d-4196-b215-9ccac1bb12a0</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;Have you considered sampling the data to RAM and using an FFT or digital filter to analyse the data.
&lt;a href="https://en.wikipedia.org/wiki/Fast_Fourier_transform"&gt;en.wikipedia.org/.../Fast_Fourier_transform&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Digital_filter"&gt;en.wikipedia.org/.../Digital_filter&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Remember by the Niquist rule you need at least 2 folder oversampling and in practical terms you probably need at least 10 folder over-sampling.&lt;/p&gt;
&lt;p&gt;I think you&amp;#39;d need to use an nRF52 for doing a FFT, as the RAM capacity and also processor speed (and lack of FPU) on the nRF51 would make this impractical or just very slow.&lt;/p&gt;
&lt;p&gt;On the nRF51, you may be able to run a digital filter by processing each sample in real time, rather than needing a buffer.
But again, I&amp;#39;m not sure if the processing power of the nRF51 would meet your needs (it would depend how complex the filter was)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>