<?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>SAADC Example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/54488/saadc-example</link><description>Hi Nordic: 
 I have a question about retart saadc. i want to restart saadc in a bsp event(BSP_EVENT_KEY_3) and it works. the following is my code: 
 
 i learned in this forum that this stop_saadc function can solve the channel data shifting problem, but</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 21 Nov 2019 04:11:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/54488/saadc-example" /><item><title>RE: SAADC Example</title><link>https://devzone.nordicsemi.com/thread/221190?ContentTypeID=1</link><pubDate>Thu, 21 Nov 2019 04:11:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e947162-53bb-46fe-acdb-39793d8d897d</guid><dc:creator>1730143</dc:creator><description>&lt;p&gt;Thanks Jared,&lt;/p&gt;
&lt;p&gt;i have solved this issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC Example</title><link>https://devzone.nordicsemi.com/thread/220894?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2019 14:42:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2acf0d2-01d8-4ef1-859a-4c489aba41b7</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;This would get you the time elapsed between the first call to the capture task to the second call. I&amp;#39;m not sure if you have a specific question or if you&amp;#39;ve solved the issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC Example</title><link>https://devzone.nordicsemi.com/thread/220885?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2019 14:20:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d216bbe-347b-4db2-a468-0ddd1db7eb28</guid><dc:creator>1730143</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;NRF_TIMER2-&amp;gt;TASKS_CAPTURE[1] = 1;
counter = NRF_TIMER2-&amp;gt;CC[1];
NRF_LOG_INFO(&amp;quot;counter:%d&amp;quot;,counter);
stop_saadc();
start_saadc();
NRF_TIMER2-&amp;gt;TASKS_CAPTURE[1] = 1;
counter = NRF_TIMER2-&amp;gt;CC[1];
NRF_LOG_INFO(&amp;quot;counter:%d&amp;quot;,counter);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I learned that i should enable Capture task again and read the &amp;quot;counter&amp;quot; value,then subtract&lt;/p&gt;
&lt;p&gt;thanks Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC Example</title><link>https://devzone.nordicsemi.com/thread/220870?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2019 13:52:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e65f5c2-af8c-4d60-a90b-9cd4a0a87e75</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]i learned in this forum that this stop_saadc function can solve the channel data shifting problem,[/quote]
&lt;p&gt;Exactly which problem are you referring to? You only need to call&amp;nbsp;nrf_drv_saadc_uninit to un-initialize the driver, alternatively you can also call&amp;nbsp;nrf_drv_saadc_abort() to make sure that you&amp;#39;re not un-initializing it in a middle of a conversion. See &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/39266/stop-and-restart-saadc-to-power-saving"&gt;this case&lt;/a&gt;. Yes, you can use a timer for measuring elapsed time between function calls.&lt;/p&gt;
[quote user="1730143"]&amp;quot;counter&amp;quot; is always 8 , it is not right. what is right way to measure time?[/quote]
&lt;p&gt;Do you mean by this that you always get 8 ticks between each time you reset the saadc?&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC Example</title><link>https://devzone.nordicsemi.com/thread/220437?ContentTypeID=1</link><pubDate>Sun, 17 Nov 2019 16:50:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a98821fc-83b1-4517-82cc-2abf13ce04d7</guid><dc:creator>1730143</dc:creator><description>&lt;p&gt;Hi Nordic:&lt;/p&gt;
&lt;p&gt;i found in this forum:&lt;/p&gt;
&lt;p&gt;i use TASK_CAPTURE to measure time consume:&lt;/p&gt;
&lt;p&gt;i enable TIMER2 in sdk_config.h&lt;/p&gt;
&lt;p&gt;code:&lt;/p&gt;
&lt;p&gt;nrf_drv_timer_config_t timer_cfg2 = NRF_DRV_TIMER_DEFAULT_CONFIG;&lt;br /&gt; timer_cfg2.bit_width = NRF_TIMER_BIT_WIDTH_32;&lt;br /&gt; timer_cfg2.mode = NRF_TIMER_MODE_TIMER;&lt;br /&gt; err_code = nrf_drv_timer_init(&amp;amp;m_timer2, &amp;amp;timer_cfg2, timer_handler);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;nrf_drv_timer_enable(&amp;amp;m_timer2);&lt;br /&gt;NRF_TIMER2-&amp;gt;TASKS_CAPTURE[1] = 1;&lt;br /&gt;stop_saadc();&lt;br /&gt;start_saadc();&lt;br /&gt;counter = NRF_TIMER2-&amp;gt;CC[1];&lt;br /&gt;NRF_LOG_INFO(&amp;quot;counter:%d&amp;quot;,counter);&lt;/p&gt;
&lt;p&gt;&amp;quot;counter&amp;quot; is always 8 , it is not right. what is right way to measure time?&lt;/p&gt;
&lt;p&gt;thanks in advance!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>