<?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>Low power pulse width measurement with LPCOMP</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/36263/low-power-pulse-width-measurement-with-lpcomp</link><description>Hi, 
 I&amp;#39;d like to be able to use an event from the LPCOMP to sample the RTC (either to a peripheral&amp;#39;s register, or to a memory address), so I can measure pulse widths without waking the processor. 
 Is there any way of doing this? It seems like EasyDMA</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 11 Jul 2018 09:58:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/36263/low-power-pulse-width-measurement-with-lpcomp" /><item><title>RE: Low power pulse width measurement with LPCOMP</title><link>https://devzone.nordicsemi.com/thread/139696?ContentTypeID=1</link><pubDate>Wed, 11 Jul 2018 09:58:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:178866fe-716a-4dcd-a7ba-97e2f30096c1</guid><dc:creator>Gordon</dc:creator><description>&lt;p&gt;Thanks!&amp;nbsp;I was using RTC0 and RTC1 but it looks like RTC2 is actually free so this would be absolutely perfect.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low power pulse width measurement with LPCOMP</title><link>https://devzone.nordicsemi.com/thread/139691?ContentTypeID=1</link><pubDate>Wed, 11 Jul 2018 09:24:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b8c76bb-a52f-407d-a448-3efb7ac5125f</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;The HF clock/oscillator&amp;nbsp;don&amp;#39;t need to be running for this, it will work using the LF clock(32kHz). The RTC&amp;nbsp;TICK is an event that is generated for every counter increment in the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/rtc.html?cp=2_1_0_24#concept_rvn_vkj_sr"&gt;RTC&lt;/a&gt;. (I don’t think this event is useful in what you are trying to do).&lt;/p&gt;
&lt;p&gt;Both &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/gpiote.html?cp=2_1_0_20#concept_knz_kww_lr"&gt;GPIOTE &lt;/a&gt;and &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/lpcomp.html?cp=2_1_0_38#concept_tdv_zkx_lr"&gt;LPCOMP &lt;/a&gt;can be used to generate separate events on rising and falling edges of a signal, if you want to measure the pulse width from when the signal crosses a specific threshold voltage, then use the LPCOMP. If you only need to measure how long the signal is logical high or low, then use GPIOTE.&lt;/p&gt;
&lt;p&gt;Then on the desired event(EVENTS_IN for GPIOTE, or EVENTS_UP,DOWN,CROSS for LPCOMP), trigger the RTC START task to start the measurement. On the next event(event that indicates the signal is high/low again), trigger the RTC STOP task. The result will then be available in the RTC COUNTER register.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low power pulse width measurement with LPCOMP</title><link>https://devzone.nordicsemi.com/thread/139579?ContentTypeID=1</link><pubDate>Tue, 10 Jul 2018 13:21:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:457e5968-bf56-4439-a8ec-e1e159ec8793</guid><dc:creator>Gordon</dc:creator><description>&lt;p&gt;Hi, sorry for the duplicate issue (the devzone website&amp;nbsp;timed out while posting).&lt;/p&gt;
&lt;p&gt;Those posts appear to suggest using the timer to count pulses, and the RTC to then trigger a task to copy the pulse count out? Obviously that works well for reasonably fast pulses, but if they are slow you need to wait a long time to get any reasonably accurate response.&lt;/p&gt;
&lt;p&gt;Is it actually possible to have a low power timer that runs at 32kHz (using RTC TICK)? Or does the high speed oscillator have to be on to be able to use the timer, making that a really bad idea?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low power pulse width measurement with LPCOMP</title><link>https://devzone.nordicsemi.com/thread/139561?ContentTypeID=1</link><pubDate>Tue, 10 Jul 2018 12:22:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4eada6fd-94b4-4e53-89b7-8c02ac4f6ca4</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I believe the best way to do any pulse width measurement is to use GPIOTE+TIMER(+RTC)+PPI. For code examples and more information, please see &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/34547/ppi-configuration-to-count-pulses/133136#133136"&gt;this&lt;/a&gt;, &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/23267/how-to-measure-two-wave-delay"&gt;this &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;this &lt;/a&gt;post.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>