<?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 Measurement - not power sensitive - low accuracy</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35382/pulse-width-measurement---not-power-sensitive---low-accuracy</link><description>We need to measure a pulse width and create an event when it changes. The change will be from 10 to 80 percent, roughly - 1mS to 8mS or more. This is a very loose requirement. 
 We can have the HFCLK run as we have lots of power. 
 We have done this with</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 14 Jun 2018 11:11:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35382/pulse-width-measurement---not-power-sensitive---low-accuracy" /><item><title>RE: Pulse Width Measurement - not power sensitive - low accuracy</title><link>https://devzone.nordicsemi.com/thread/136138?ContentTypeID=1</link><pubDate>Thu, 14 Jun 2018 11:11:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aca1bb4b-a9df-4f81-a7f7-a6ea569859d9</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote userid="54508" url="~/f/nordic-q-a/35382/pulse-width-measurement---not-power-sensitive---low-accuracy"]1. Can we use the GPIOTE to generate the event that will trigger the capture on the rising, falling, or either edge of the PWM signal to determine the duty cycle of the incoming signal?[/quote]
&lt;p&gt;Yes, that is possible.&lt;/p&gt;
[quote userid="54508" url="~/f/nordic-q-a/35382/pulse-width-measurement---not-power-sensitive---low-accuracy"]2. Is there a simpler way to use the GPIOTE, Timer, and PPI to measure the duty cycle of an incoming PWM signal?[/quote]
&lt;p&gt;Using GPIOTE+TIMER+PPI is the way to go here.&lt;/p&gt;
[quote userid="54508" url="~/f/nordic-q-a/35382/pulse-width-measurement---not-power-sensitive---low-accuracy"]3. Since we are only interested in a duty cycle that EXCEEDS around 10 percent or is 10 percent or less, is there another approach?[/quote]
&lt;p&gt;The approach will in either case be very similar(need to use GPIOTE+TIMER+PPI).&lt;/p&gt;
[quote userid="54508" url="~/f/nordic-q-a/35382/pulse-width-measurement---not-power-sensitive---low-accuracy"]4. Are there any code examples in SDK15 for any of these?[/quote]
&lt;p&gt;There is no example in the SDK that does this, but there are several posts here at devzone with code examples.&lt;/p&gt;
&lt;p&gt;See these posts: &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/34547/ppi-configuration-to-count-pulses/133136#133136"&gt;Link 1&lt;/a&gt;, &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/23267/how-to-measure-two-wave-delay"&gt;link 2&lt;/a&gt; and &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/9036/measuring-input-gpio-pin-frequency-with-soft-device-running/33289#33289"&gt;link 3&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>