<?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>How to use input pin timer / capture function in zephyr API</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/121966/how-to-use-input-pin-timer-capture-function-in-zephyr-api</link><description>I have a application where I need to time acurately the time between two enternal pin signals. I have this working using the 
 
 k_timer which &amp;amp; read &amp;amp; restart within the GPIO ISR. This works well unit I enable BT then the timings are wrong use to the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 06 Jun 2025 13:01:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/121966/how-to-use-input-pin-timer-capture-function-in-zephyr-api" /><item><title>RE: How to use input pin timer / capture function in zephyr API</title><link>https://devzone.nordicsemi.com/thread/538424?ContentTypeID=1</link><pubDate>Fri, 06 Jun 2025 13:01:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbb71966-33d2-4b2a-88ac-8c7d884fcd2e</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Ah right, I should have thought of that issue as well. My apologies.&lt;/p&gt;
&lt;p&gt;In wireless application, the Multiprotocol Service Layer (MPSL) reserves some peripherals. The details are here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-3.0.2/page/nrfxlib/mpsl/doc/mpsl.html"&gt;https://docs.nordicsemi.com/bundle/ncs-3.0.2/page/nrfxlib/mpsl/doc/mpsl.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use input pin timer / capture function in zephyr API</title><link>https://devzone.nordicsemi.com/thread/538412?ContentTypeID=1</link><pubDate>Fri, 06 Jun 2025 12:19:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:658a2320-e34e-401e-a97d-847de32a0538</guid><dc:creator>John Galvin</dc:creator><description>&lt;p&gt;Thank you this should help me with further parts for my project.&lt;/p&gt;
&lt;p&gt;I now have GPIOTE, PPI, TIMER1 &amp;amp; TIMER 2 all working at I want them too &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Just as an aside, I building this into the&amp;nbsp;Nordic UART Bridge Service (NUS) sample (ntf/samples/bluetooth/peripheral_uart) &amp;amp; after some time of stuggling I found that TIMER0 was throwing an exception &amp;amp; looking thru the map file &amp;amp; source files I found the irq_tables.c has this device pointing at&amp;nbsp;&amp;nbsp;.text.mpsl_timer0_isr_wrapper. There is nothing in this sample code documentation that mentions the use of TIMER0.&lt;/p&gt;
&lt;p&gt;Is there any other resurces that are not avaiable if I build my application based on this sample code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use input pin timer / capture function in zephyr API</title><link>https://devzone.nordicsemi.com/thread/538317?ContentTypeID=1</link><pubDate>Thu, 05 Jun 2025 21:32:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6a1cea1-fab0-4611-8191-744dfc87b4f1</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Ah, I see. Sorry, I misunderstood your approach previously, but this idea&amp;nbsp;is indeed a good use case of the&amp;nbsp;PPI peripheral.&lt;/p&gt;
&lt;p&gt;Enabling the nrfx driver is indeed as simple as enabling the CONFIG_NRFX_&amp;lt;peripheral name&amp;gt; Kconfig. The Kconfigs are setup so that just enabling the peripheral would&amp;nbsp;trigger the relevant driver to build.&lt;br /&gt;See&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-3.0.2/page/kconfig/index.html#CONFIG_NRFX_TIMER2"&gt;CONFIG_NRFX_TIMER2&lt;/a&gt;&amp;nbsp;for example, it selects&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-3.0.2/page/kconfig/index.html#CONFIG_NRFX_TIMER"&gt;CONFIG_NRFX_TIMER&lt;/a&gt;, which enable the nrfx_timer driver.&lt;/p&gt;
&lt;p&gt;As for how to use the drivers,&amp;nbsp;there are two sources of information:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.nordicsemi.com/bundle/nrfx-apis-latest/page/index.html"&gt;nrfx API documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;nrfx samples, found in &amp;lt;SDK&amp;gt;\modules\hal\nordic\nrfx\samples, or&amp;nbsp;&lt;a href="https://github.com/zephyrproject-rtos/hal_nordic/tree/nrfx-3.9.0/nrfx/samples"&gt;hal_nordic/nrfx/samples at nrfx-3.9.0 · zephyrproject-rtos/hal_nordic&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Please let me know if you need&amp;nbsp;any&amp;nbsp;further elaboration.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use input pin timer / capture function in zephyr API</title><link>https://devzone.nordicsemi.com/thread/537978?ContentTypeID=1</link><pubDate>Wed, 04 Jun 2025 07:21:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af5b6ead-4722-47f2-bab1-6f08875bb69b</guid><dc:creator>John Galvin</dc:creator><description>&lt;p&gt;I&amp;#39;m aware of the IRQ latency issues which is why I want to use the timer capture function so when the ISR is eventuare called, the latency will not effect the actual pin event result on the timer capture value.&lt;/p&gt;
&lt;p&gt;However, I&amp;#39;m struggling to find any consice information of using the nrfx timer function within the VS code nRF connect extention.&lt;/p&gt;
&lt;p&gt;I guess I&amp;#39;m missing something as I can&amp;#39;t find anything in the Nordic help which tells me how in use their drivers &amp;amp; e.g. how to add timers to my project. I did find this post which said to add&amp;nbsp;&lt;span class="hljs-attr"&gt;CONFIG_NRFX_TIMER2&lt;/span&gt;&lt;span&gt;=y to prj.conf,&amp;nbsp;which helped, but this was just in a question asked on community site.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a id="" href="https://community.platformio.org/t/how-to-link-with-nordic-nrfx-library/27040"&gt;https://community.platformio.org/t/how-to-link-with-nordic-nrfx-library/27040&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you able to fill in the blanks for me either specifically how to setup the GPIOTE pin to trigger a timer capture thru PPI or more generally with access to a more formal &amp;amp; conprehensive source of help/documentation on the &lt;span&gt;nRF connect &lt;/span&gt;NRFX library useage within VS code&lt;/p&gt;
&lt;p&gt;Many thanks in advance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use input pin timer / capture function in zephyr API</title><link>https://devzone.nordicsemi.com/thread/537934?ContentTypeID=1</link><pubDate>Tue, 03 Jun 2025 18:04:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c805943-b4ba-4493-9b2f-0a7449f2815a</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi John,&lt;/p&gt;
&lt;p&gt;There is no Zephyr API that makes use of the nrfx_timer driver at all, so I believe using the Timer peripheral&amp;#39;s capture feature is not possible with Zephyr API. You will need to use nrfx driver directly.&lt;/p&gt;
&lt;p&gt;Please also know that the SoftDevice Controller will reserve some highest priorities, so even if you use nrfx driver and direct Timer peripheral interrupt, the latency of recording the timing cannot be guaranteed to be constant.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use input pin timer / capture function in zephyr API</title><link>https://devzone.nordicsemi.com/thread/537787?ContentTypeID=1</link><pubDate>Tue, 03 Jun 2025 07:44:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f4ef5c4-3d26-4aa8-a08a-b37fc4e8ff95</guid><dc:creator>John Galvin</dc:creator><description>&lt;p&gt;Typo &amp;quot;&lt;span&gt;&lt;em&gt;I&amp;#39;m using up-to-date &lt;strong&gt;nRF&lt;/strong&gt; Connect for VS Code &amp;amp; the Extention pack&lt;/em&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>