<?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>52832 ADC just do samle one time</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/23524/52832-adc-just-do-samle-one-time</link><description>Hi, 
 I&amp;#39;m using the ADC of nRF52832 on nRF5 SDK V12.2. The setting as attachment. I found that it just do sample one time. But I have use timer to call nrf_drv_saadc_sample() to the SAADC sample task every second. However, I just can see one adc result</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 Jul 2017 12:44:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/23524/52832-adc-just-do-samle-one-time" /><item><title>RE: 52832 ADC just do samle one time</title><link>https://devzone.nordicsemi.com/thread/92406?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2017 12:44:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f5048fe-6475-4cd8-a86c-58faec6292a7</guid><dc:creator>Alice</dc:creator><description>&lt;p&gt;Well done! It&amp;#39;s OK now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52832 ADC just do samle one time</title><link>https://devzone.nordicsemi.com/thread/92405?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2017 11:57:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2cede0c1-85ec-4bea-a62a-b722261c2b80</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi Alice,&lt;/p&gt;
&lt;p&gt;I see you use low power mode in the SAADC driver. There is some issues with this mode in SDK 12.x.0 driver. You should use the driver (&lt;em&gt;nrf_drv_saadc.c&lt;/em&gt;) from SDK 13 instead. I tested this whit your code, and it seems to solve the issue. I would also suggest that you enable burst mode in &lt;code&gt;saadc_init()&lt;/code&gt; if using oversample, to avoid having to wait for multiple calls to &lt;code&gt;nrf_drv_saadc_sample()&lt;/code&gt; to get one result:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;channel_config.burst = NRF_SAADC_BURST_ENABLED;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52832 ADC just do samle one time</title><link>https://devzone.nordicsemi.com/thread/92404?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2017 09:13:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03596edb-f2f7-4687-b39c-8510faceb1f0</guid><dc:creator>Alice</dc:creator><description>&lt;p&gt;Hi Wojtek, yes, I have started SAADC after each sampling.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52832 ADC just do samle one time</title><link>https://devzone.nordicsemi.com/thread/92403?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2017 09:12:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2f74ab2-64e3-492a-973d-a8bea490a0dc</guid><dc:creator>Alice</dc:creator><description>&lt;p&gt;Hi Jørgen ,
I check the err_code for the nrf_drv_saadc_sample as you said, no error. Do you have a similar example that adc works at low power mode? I have no idear to solve the problem. It&amp;#39;s too stranged.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52832 ADC just do samle one time</title><link>https://devzone.nordicsemi.com/thread/92402?ContentTypeID=1</link><pubDate>Mon, 17 Jul 2017 15:11:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:278376d6-2a01-4a43-a345-5f8bb9deaa53</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;Just a blind shot, because I cannot check your code right now. Do you start SAADC after each sampling? You have to.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52832 ADC just do samle one time</title><link>https://devzone.nordicsemi.com/thread/92401?ContentTypeID=1</link><pubDate>Mon, 17 Jul 2017 14:57:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93eeab17-ed90-4748-82d9-d5a13d27f73b</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;I can&amp;#39;t see anything in particular that should stop the sampling after one sample, but you should try checking all error codes, to make sure no functions return errors:&lt;/p&gt;
&lt;p&gt;In &lt;code&gt;battery_voltage_timeout_handler()&lt;/code&gt;, check the error code from &lt;code&gt;nrf_drv_saadc_sample()&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t err_code = nrf_drv_saadc_sample(); //Trigger the SAADC SAMPLE task
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You should also check error codes on calls to &lt;code&gt;app_timer_create&lt;/code&gt; and &lt;code&gt;app_timer_start&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52832 ADC just do samle one time</title><link>https://devzone.nordicsemi.com/thread/92400?ContentTypeID=1</link><pubDate>Mon, 17 Jul 2017 12:06:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a839c6b6-1546-40ed-875e-8f3edbf16c34</guid><dc:creator>Alice</dc:creator><description>&lt;p&gt;The whole project is too large, so I upload the main.c document, pls see the attachment. Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52832 ADC just do samle one time</title><link>https://devzone.nordicsemi.com/thread/92399?ContentTypeID=1</link><pubDate>Mon, 17 Jul 2017 11:05:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf5d01d1-3a73-45be-a727-0dd0f093565f</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Could you upload the code for review/debugging?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52832 ADC just do samle one time</title><link>https://devzone.nordicsemi.com/thread/92398?ContentTypeID=1</link><pubDate>Mon, 17 Jul 2017 02:25:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b82fe5d6-727c-42ab-8937-25d7642f0370</guid><dc:creator>Alice</dc:creator><description>&lt;p&gt;I use &lt;code&gt;APP_TIMER_DEF(m_battery_voltage_id);&lt;/code&gt;to creat a timer and then I use nrf_drv_saadc_sample() to trigger the ADC to sample when the timer timeout. The &lt;code&gt;SAADC_SAMPLES_IN_BUFFER&lt;/code&gt; is 1, I also try other number such as 5, but the result is the same. I know the code is runing well ,because the timer is running all the time and I will prinf a debug information when timer timeout.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52832 ADC just do samle one time</title><link>https://devzone.nordicsemi.com/thread/92397?ContentTypeID=1</link><pubDate>Fri, 14 Jul 2017 09:35:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:921d1e3e-98ea-44ed-b9f7-a14c382e63a5</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Your code does not show how you trigger sampling. It is very hard to say why it only trigger one sample without seeing the rest of your code. Do you know if your code continues to run or if it halts at an error? What is the size of &lt;code&gt;SAADC_SAMPLES_IN_BUFFER&lt;/code&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>