<?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>COMP stop task</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/28170/comp-stop-task</link><description>Right now I&amp;#39;m stuck with the COMP driver. What I am trying to do is.
Initialise COMP, start COMP with interrupt and STOP shortcut.
Once I handled the interrupt I just want to start the COMP again with an interrupt and a shortcut.
However, when trying</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Dec 2017 09:10:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/28170/comp-stop-task" /><item><title>RE: COMP stop task</title><link>https://devzone.nordicsemi.com/thread/111274?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2017 09:10:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58d97c17-90ac-4245-8734-2c7da063bf0f</guid><dc:creator>TY</dc:creator><description>&lt;p&gt;OK, thank you. Yes, that was my question. I could wrap my head around how to use the Shortcut feature and nrf_drv APIs in combination. Now it makes sense.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: COMP stop task</title><link>https://devzone.nordicsemi.com/thread/111273?ContentTypeID=1</link><pubDate>Mon, 11 Dec 2017 15:54:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:532fa2a8-b76d-45e1-9759-422f5088f2b2</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;It seems like I didn&amp;#39;t read your initial post carefully enough, but I&amp;#39;m still not sure if I understand your question though. When you call &lt;code&gt;nrf_drv_comp_start&lt;/code&gt;() with &lt;code&gt;NRF_DRV_COMP_SHORT_STOP_AFTER_DOWN_EVT&lt;/code&gt; as the second parameter you are telling the nRF to stop the the comparator after the first down event. This all happens inside the comparator HW with &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/comp.html?cp=2_1_0_37_2_0#register.SHORTS"&gt;shortcuts&lt;/a&gt; and doesn&amp;#39;t seem to change anything in the comp driver. Hence you will need to track this in your application yourself. If you just want the comparator to continue you can call &lt;code&gt;nrf_drv_comp_start(NRF_DRV_COMP_EVT_EN_DOWN_MASK, 0);&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: COMP stop task</title><link>https://devzone.nordicsemi.com/thread/111271?ContentTypeID=1</link><pubDate>Thu, 07 Dec 2017 10:15:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74fd402f-c001-4293-8d3d-104cad4fc983</guid><dc:creator>TY</dc:creator><description>&lt;p&gt;Thank you for your reply, meanwhile I&amp;#39;m familar with the COMP driver.
My main question right now is, when I start the COMP after Init with:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;nrf_drv_comp_start(NRF_DRV_COMP_EVT_EN_DOWN_MASK, NRF_DRV_COMP_SHORT_STOP_AFTER_DOWN_EVT);&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;And the DOWN Event gets triggered the nRF is doing some magic and stopping the COMP.
Is the driver module (m_state) aware that the COMP has been stopped?
Meaning ist the STOP Task essentially the same as calling:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;nrf_drv_comp_stop()&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: COMP stop task</title><link>https://devzone.nordicsemi.com/thread/111272?ContentTypeID=1</link><pubDate>Thu, 07 Dec 2017 07:30:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4c26bd0-c010-421f-9e98-02084bd1e3ff</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi, Did you figure this out yet?&lt;/p&gt;
&lt;p&gt;Te driver state should change from &lt;code&gt;NRF_DRV_STATE_UNINITIALIZED&lt;/code&gt; to &lt;code&gt;NRF_DRV_STATE_INITIALIZED&lt;/code&gt; when you call &lt;code&gt;nrf_drv_comp_init()&lt;/code&gt; and vise versa when you call &lt;code&gt;nrf_drv_comp_uninit()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Furthermore the state will change to &lt;code&gt;NRF_DRV_STATE_POWERED_ON&lt;/code&gt; when you start the comp with &lt;code&gt;nrf_drv_comp_start()&lt;/code&gt;. Hence if you try to call &lt;code&gt;nrf_drv_comp_start()&lt;/code&gt; once more by calling e.g. &lt;code&gt;nrf_drv_comp_stop()&lt;/code&gt;, &lt;code&gt;ASSERT(m_state == NRF_DRV_STATE_POWERED_ON);&lt;/code&gt; will assert because the state is &lt;code&gt;NRF_DRV_STATE_POWERED_ON&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>