<?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>Pulse Width Counter using peripheral only</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93005/pulse-width-counter-using-peripheral-only</link><description>We have a hall sensor with pwm output encoding the information in the duty cycle of pwm. Now we would like to read the duty cycle without the use of an interrupt, but solely using the nrf52840 timer peripheral. 
 It seems impossible to find an example</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 19 Oct 2022 14:02:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93005/pulse-width-counter-using-peripheral-only" /><item><title>RE: Pulse Width Counter using peripheral only</title><link>https://devzone.nordicsemi.com/thread/391461?ContentTypeID=1</link><pubDate>Wed, 19 Oct 2022 14:02:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca043033-bfc1-4561-ba37-09bdad471218</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Martin&lt;/p&gt;
&lt;p&gt;That is great news &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;For full disclosure, since I had limited time to make the example I didn&amp;#39;t take the time to properly&amp;nbsp;implement it as a Zephyr library. Ideally you would want to integrate the example with the Kconfig and device tree architecture, rather than hard coding everything in the application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I might try to do this later, but I don&amp;#39;t know when I will have more time to look at it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pulse Width Counter using peripheral only</title><link>https://devzone.nordicsemi.com/thread/391342?ContentTypeID=1</link><pubDate>Wed, 19 Oct 2022 07:24:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e3b207e-508f-4ad2-a034-99ed0deb4175</guid><dc:creator>Martin Rupp</dc:creator><description>&lt;p&gt;Hello Torbjorn,&lt;/p&gt;
&lt;p&gt;I got word from our FW engineer, he says it is running fine.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for your support,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Martin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pulse Width Counter using peripheral only</title><link>https://devzone.nordicsemi.com/thread/391341?ContentTypeID=1</link><pubDate>Mon, 17 Oct 2022 04:48:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a4149ca-db23-4ad9-bd1c-64b3d0d6d8c9</guid><dc:creator>Martin Rupp</dc:creator><description>&lt;p&gt;thanks a lot, we will test this as soon as possible.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Martin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pulse Width Counter using peripheral only</title><link>https://devzone.nordicsemi.com/thread/391340?ContentTypeID=1</link><pubDate>Sat, 15 Oct 2022 11:08:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5197aa32-7975-41ed-ba33-194f6f0187fc</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Martin&lt;/p&gt;
&lt;p&gt;Please have a look at this example:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/pulse_5F00_length_5F00_measurement.zip"&gt;devzone.nordicsemi.com/.../pulse_5F00_length_5F00_measurement.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pulse Width Counter using peripheral only</title><link>https://devzone.nordicsemi.com/thread/391339?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2022 13:20:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6836d0a-41b9-48b0-beaf-e2b0e563516e</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Martin&lt;/p&gt;
&lt;p&gt;I will try to provide an example by the end of the week.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pulse Width Counter using peripheral only</title><link>https://devzone.nordicsemi.com/thread/391338?ContentTypeID=1</link><pubDate>Fri, 07 Oct 2022 13:48:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ddcbebe-78de-4ce7-9928-7fad6575dc95</guid><dc:creator>Martin Rupp</dc:creator><description>&lt;p&gt;Hello Torbjorn,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for responding so quickly. We are using nRF Connect.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sounds straight forward indeed. If you happen to have an example, this would accelerate things greatly.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Martin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pulse Width Counter using peripheral only</title><link>https://devzone.nordicsemi.com/thread/391337?ContentTypeID=1</link><pubDate>Fri, 07 Oct 2022 13:28:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b41e87d-aff0-4e46-8086-05f88ff9751e</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Martin&lt;/p&gt;
&lt;p&gt;Which SDK are you using?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It should be relatively straight forward to implement something like this. Essentially you need to set up two GPIOTE channels on the same pin, one configured to generate an event on a low to high transition, and one for the high to low transition.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then you need to connect the first GPIOTE channel to the timer START task over PPI, and the second GPIOTE channel needs to be connected to the timer STOP, CLEAR and CAPTURE tasks (for this you will need an additional two PPI channels).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then you can just read the corresponding CC register any time you want to know the value of the last pulse.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>