<?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>Nrfx timer capturing/comparing</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114477/nrfx-timer-capturing-comparing</link><description>Hi, 
 I&amp;#39;m aiming to develop a custom two-wire serial interface (TX, RX). To achieve this, I&amp;#39;m planning to implement output capture for TX and use GPIO interrupts for RX. For the RX side, I&amp;#39;ll need to read a microsecond timer to measure the time duration</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 05 Sep 2024 14:15:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114477/nrfx-timer-capturing-comparing" /><item><title>RE: Nrfx timer capturing/comparing</title><link>https://devzone.nordicsemi.com/thread/501396?ContentTypeID=1</link><pubDate>Thu, 05 Sep 2024 14:15:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:656e95de-b1cd-4817-a376-9088dc166af7</guid><dc:creator>Sigurd</dc:creator><description>[quote user="trafficode"]Major question is: Why I read so bad values from channel 1 if it is not used to nothing more, and it looks like is reseted when channel 2 is captured...[/quote]
&lt;p&gt;Looking at the code, you have e.g. this line:&lt;/p&gt;
&lt;p&gt;nrfx_timer_extended_compare(&amp;amp;TimerInst, NRF_TIMER_CC_CHANNEL2, cc + us,&lt;br /&gt; NRF_TIMER_SHORT_COMPARE2_CLEAR_MASK, true);&lt;/p&gt;
&lt;p&gt;So you have a&amp;nbsp;s&lt;span&gt;hortcut between the compare event on the channel and the timer CLEAR task &lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nrfx timer capturing/comparing</title><link>https://devzone.nordicsemi.com/thread/501279?ContentTypeID=1</link><pubDate>Thu, 05 Sep 2024 06:54:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee6d9667-b312-45c9-b2f7-92778722f08b</guid><dc:creator>trafficode</dc:creator><description>&lt;p&gt;Yeap&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nrfx timer capturing/comparing</title><link>https://devzone.nordicsemi.com/thread/501181?ContentTypeID=1</link><pubDate>Wed, 04 Sep 2024 13:39:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:277a72b7-812f-4eb1-a5b1-d6a4d23817e2</guid><dc:creator>Sigurd</dc:creator><description>[quote user="trafficode"]One thing I forgot to mention is that I have it working with &lt;strong&gt;nRF Connect SDK 1.8&lt;/strong&gt;, but I&amp;#39;m encountering problems while trying to migrate to the newest version.[/quote]
&lt;p&gt;You are testing with NCS 2.7.0 ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nrfx timer capturing/comparing</title><link>https://devzone.nordicsemi.com/thread/501174?ContentTypeID=1</link><pubDate>Wed, 04 Sep 2024 13:15:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71e6fe30-2778-459f-af52-9402d3a2802d</guid><dc:creator>trafficode</dc:creator><description>&lt;p&gt;You did this for a very old version of nrfx. One thing I forgot to mention is that I have it working with &lt;strong&gt;nRF Connect SDK 1.8&lt;/strong&gt;, but I&amp;#39;m encountering problems while trying to migrate to the newest version. Previously I was using input capture to measure input pulse, this one I decided to start with something more simple.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Major question is: Why I read so bad values from channel 1 if it is not used to nothing more, and it looks like is reseted when channel 2 is captured...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Nrfx timer capturing/comparing</title><link>https://devzone.nordicsemi.com/thread/501152?ContentTypeID=1</link><pubDate>Wed, 04 Sep 2024 12:23:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7eedb63-954d-45bf-bf8c-3221c3b0bc1c</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;I implemented a &amp;quot;pulse detector&amp;quot; some years ago, it measures the time, and gives the frequency of the input signal. Maybe that can be useful in what you are trying to do:&amp;nbsp;&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>