<?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>Measuring 1hz to 1Mhz Input frequency on up to 6 GPIOs with maximum possible high accuracy.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118219/measuring-1hz-to-1mhz-input-frequency-on-up-to-6-gpios-with-maximum-possible-high-accuracy</link><description>My board is nRF5340Dk with NCS 2.6.1 and toolchain 2.6.1. 
 At this development stage I want to measure continuously incoming frequency ranging from 1Hz to 1MHz with high accuracy possible. I have tried looking into some previous similar question and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 23 Jan 2025 02:54:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118219/measuring-1hz-to-1mhz-input-frequency-on-up-to-6-gpios-with-maximum-possible-high-accuracy" /><item><title>RE: Measuring 1hz to 1Mhz Input frequency on up to 6 GPIOs with maximum possible high accuracy.</title><link>https://devzone.nordicsemi.com/thread/519674?ContentTypeID=1</link><pubDate>Thu, 23 Jan 2025 02:54:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2eb368dd-44ce-4630-96cf-2d067a05e777</guid><dc:creator>frogrammer</dc:creator><description>&lt;p&gt;Also, i have checked the code with PWM input which works fine and stable. That PWM code i have found from one of your GitHub links. &lt;a id="" href="https://github.com/sigurdnev/ncs-playground/blob/master/samples/pulse_detector/src/main.c"&gt;https://github.com/sigurdnev/ncs-playground/blob/master/samples/pulse_detector/src/main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I just had to adjust NRF_P0 instead of NRF_GPIO. Finally, i checked with different Frequency Generation to Detection.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Another question is, can I just make 6 instances of this code with different DPPI channels, Timers CC?&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/sigurdon"&gt;Sigurd&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Will all these instances affect BLE or I2C?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Measuring 1hz to 1Mhz Input frequency on up to 6 GPIOs with maximum possible high accuracy.</title><link>https://devzone.nordicsemi.com/thread/519629?ContentTypeID=1</link><pubDate>Wed, 22 Jan 2025 16:57:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d8eb983-b848-48da-b836-042d726965a8</guid><dc:creator>frogrammer</dc:creator><description>&lt;p&gt;I do not have a logic analyser.&lt;/p&gt;
&lt;p&gt;right now my input frequency is coming from a Schmitt trigger output so I will try to check with a PWM input from another nrf microcontroller.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Measuring 1hz to 1Mhz Input frequency on up to 6 GPIOs with maximum possible high accuracy.</title><link>https://devzone.nordicsemi.com/thread/519625?ContentTypeID=1</link><pubDate>Wed, 22 Jan 2025 16:41:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2502180-c951-4e87-a4bc-52a0d44b5723</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;Do you have a logic analyzer to check what the&amp;nbsp;frequency deviation actually is? e.g. a&amp;nbsp;saleae logic analyzer.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Measuring 1hz to 1Mhz Input frequency on up to 6 GPIOs with maximum possible high accuracy.</title><link>https://devzone.nordicsemi.com/thread/519428?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2025 23:01:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1042eeb3-aab5-4dcb-94f3-93fdaceb918a</guid><dc:creator>frogrammer</dc:creator><description>&lt;p&gt;Thank you so much for the code. I appreciate your time. However, I have tested this frequency measurement based on Counting pulse at 100ms and it varies +- 150 at only 105KHz.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Average freq: 105420 [Hz]
C: 10542
Average freq: 105440 [Hz]
C: 10544
Average freq: 105430 [Hz]
C: 10543
Average freq: 105440 [Hz]
C: 10544
Average freq: 105420 [Hz]
C: 10542
Average freq: 105410 [Hz]
C: 10541
Average freq: 105390 [Hz]
C: 10539
Average freq: 105380 [Hz]
C: 10538
Average freq: 105390 [Hz]
C: 10539
Average freq: 105370 [Hz]
C: 10537
Average freq: 105330 [Hz]
C: 10533
Average freq: 105350 [Hz]
C: 10535
Average freq: 105370 [Hz]
C: 10537
Average freq: 105330 [Hz]
C: 10533
Average freq: 105320 [Hz]
C: 10532
Average freq: 105330 [Hz]
C: 10533&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The variations are quite rough. Is it the highest limit of an nRF5340?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Although, I didn&amp;#39;t provide the pin 28 a stable known frequency but my current setup did result stable frequency measurement on an Arduino Uno mini like this :-&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt; 1. 13:58:25.443 -&amp;gt; 110344.83
 2. 13:58:25.803 -&amp;gt; 110344.83
 3. 13:58:26.079 -&amp;gt; 110344.83
 4. 13:58:26.423 -&amp;gt; 110344.83
 5. 13:58:26.716 -&amp;gt; 110344.83
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Measuring 1hz to 1Mhz Input frequency on up to 6 GPIOs with maximum possible high accuracy.</title><link>https://devzone.nordicsemi.com/thread/519426?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2025 22:23:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d201df4-033a-4281-820d-05838154dcc3</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Try this:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/pulse_5F00_counter.rar"&gt;devzone.nordicsemi.com/.../pulse_5F00_counter.rar&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Connect a jumper-wire between P0.05 and P0.28 to test.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Measuring 1hz to 1Mhz Input frequency on up to 6 GPIOs with maximum possible high accuracy.</title><link>https://devzone.nordicsemi.com/thread/519331?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2025 14:15:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0078eef3-c7b9-4844-a877-1779f994b9f1</guid><dc:creator>frogrammer</dc:creator><description>&lt;p&gt;I have tried your program,&lt;/p&gt;
&lt;p&gt;It didn&amp;#39;t run properly on NCS 2.6.1 , it showed :&lt;pre class="ui-code" data-mode="text"&gt;error: NRFX_GPIOTE (defined at C:/ncs/v2.6.1/zephyr/modules/hal_nordic\nrfx/Kconfig:70,
modules\hal_nordic\nrfx/Kconfig:70) is assigned in a configuration file, but is not directly user-
configurable (has no prompt). It gets its value indirectly from other symbols. See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_NRFX_GPIOTE and/or look up NRFX_GPIOTE in
the menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration
Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful too.
Parsing C:/ncs/v2.6.1/zephyr/Kconfig
Loaded configuration &amp;#39;C:/ncs/v2.6.1/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_defconfig&amp;#39;
Merged configuration &amp;#39;C:/ncs/test/count_pulse/prj.conf&amp;#39;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Also, It couldn&amp;#39;t find&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;drivers/gpio.h&amp;gt;
#include &amp;lt;zephyr.h&amp;gt;
#include &amp;lt;logging/log.h&amp;gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So, I have changed header files to&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/device.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;
#include &amp;lt;zephyr/drivers/gpio.h&amp;gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Would you mind checking it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Measuring 1hz to 1Mhz Input frequency on up to 6 GPIOs with maximum possible high accuracy.</title><link>https://devzone.nordicsemi.com/thread/519311?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2025 13:27:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f40bbf81-b562-4411-afda-364f30b20662</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;I made an example here some years ago:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/sigurdnev/ncs-playground/blob/master/samples/pulse_detector/src/main.c"&gt;https://github.com/sigurdnev/ncs-playground/blob/master/samples/pulse_detector/src/main.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>