<?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>saacd scan oversample</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/26659/saacd-scan-oversample</link><description>Hi, I&amp;#39;m trying to set up my SAADC to measure VDD and battery voltage on AIN3. According to this post , later versions of the SDK were modified so that one could use scan, burst, and oversample. But I&amp;#39;m using 14.1, and it seems like nrf_drv_saadc_channel_init</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 24 Sep 2020 21:40:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/26659/saacd-scan-oversample" /><item><title>RE: saacd scan oversample</title><link>https://devzone.nordicsemi.com/thread/271408?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2020 21:40:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78ef8422-7a7c-44e4-819b-d5ebcb7f1f5c</guid><dc:creator>ankurt</dc:creator><description>&lt;p&gt;Correct, your example works well and found out that the problem was in our application, it works well too now. So no issue here, all good &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saacd scan oversample</title><link>https://devzone.nordicsemi.com/thread/271247?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2020 08:02:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dfc150da-8424-4520-9378-f2a19cc78675</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;OK, so you are not able to reproduce this issue with the example from GitHub, without any modifications?&lt;/p&gt;
&lt;p&gt;In that case, I would recommend you to post a new ticket where you describe the issue in details, and include the full project and/or how you integrated it into an example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saacd scan oversample</title><link>https://devzone.nordicsemi.com/thread/271199?ContentTypeID=1</link><pubDate>Wed, 23 Sep 2020 21:04:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f0c7447-acb5-4b58-a744-ed99ba0cbf51</guid><dc:creator>ankurt</dc:creator><description>&lt;p&gt;I was running it on nRF52840 with SD enabled and it gets into this situation within 5-10 min every time I try.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saacd scan oversample</title><link>https://devzone.nordicsemi.com/thread/270837?ContentTypeID=1</link><pubDate>Tue, 22 Sep 2020 12:17:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8aff389d-5282-48fb-a773-d72e163747e8</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Which chip/DK did you run the example on? How long did you run it before getting into this situation?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saacd scan oversample</title><link>https://devzone.nordicsemi.com/thread/270432?ContentTypeID=1</link><pubDate>Mon, 21 Sep 2020 01:03:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84b3ffb9-1d7f-48d3-a57e-81cba173bcd9</guid><dc:creator>ankurt</dc:creator><description>&lt;p&gt;Thanks, I tried example &lt;a href="https://github.com/NordicPlayground/nRF52-ADC-examples/blob/master/nrfx_saadc_simple_low_power_app_timer_multichannel_oversample/main.c"&gt;https://github.com/NordicPlayground/nRF52-ADC-examples/blob/master/nrfx_saadc_simple_low_power_app_timer_multichannel_oversample/main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But after some time, it stops and seems as if CPU is stuck but not sure where as no s/w application exception is raised. When I pause debugger, it stop at &amp;quot;Unknown function at 0x00025F40&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saacd scan oversample</title><link>https://devzone.nordicsemi.com/thread/270303?ContentTypeID=1</link><pubDate>Fri, 18 Sep 2020 10:56:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c8c4c2b-0e48-46a9-ad41-f40acd195aeb</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;There are examples available on GitHub, linked from the SDK migration guide:&amp;nbsp;&lt;a title="SAADC driver backported from nrfx 2.2.0" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/migration.html?cp=7_1_1_7_2_0#migr_lib_nrfx"&gt;SAADC driver backported from nrfx 2.2.0&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I have also implemented some examples in the nRF5 SDK, which I soon will make available in &lt;a href="https://github.com/NordicPlayground/nRF52-ADC-examples"&gt;this GitHub repository&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saacd scan oversample</title><link>https://devzone.nordicsemi.com/thread/270196?ContentTypeID=1</link><pubDate>Fri, 18 Sep 2020 00:39:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b856f231-62eb-46fa-bd2a-e797d537a24e</guid><dc:creator>ankurt</dc:creator><description>&lt;p&gt;I was struggling with similar problem and looks like V2 API is good. But my application is based upon V1 api using nrf drv saadc leagcy layer. If no example, then at least a porting guide/document will be very helpful.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saacd scan oversample</title><link>https://devzone.nordicsemi.com/thread/265910?ContentTypeID=1</link><pubDate>Mon, 24 Aug 2020 08:46:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:972c151f-0d73-4df9-83ad-586279f9e024</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;It is not supported in SDK 16.&amp;nbsp;Similar&amp;nbsp;modifications to the ones described above can be added to nrfx_saadc.c.&lt;/p&gt;
&lt;p&gt;Scan + burst is supported in &lt;a href="https://github.com/NordicSemiconductor/nrfx/blob/v1.8.4/drivers/src/nrfx_saadc.c#L926"&gt;SDK 17.0.0 with&amp;nbsp;NRFX_SAADC_API_V2&lt;/a&gt;. Unfortunately, there are no examples in the SDK showing the usage of this new driver implementation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saacd scan oversample</title><link>https://devzone.nordicsemi.com/thread/263795?ContentTypeID=1</link><pubDate>Mon, 10 Aug 2020 10:51:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cec14a34-5dd3-46fd-83b8-fc0fc281ba14</guid><dc:creator>Coder_hope</dc:creator><description>&lt;p&gt;I am using SDK 15,it this is not supported too,do you figure out this problem?I am using 14bit oversampling, and&amp;nbsp;SAADC_CONFIG_OVERSAMPLE&amp;nbsp; - Sample period is disabled , the noise is&amp;nbsp; not reduced..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saacd scan oversample</title><link>https://devzone.nordicsemi.com/thread/263500?ContentTypeID=1</link><pubDate>Thu, 06 Aug 2020 22:35:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f85c5dd1-caab-43a9-8206-ded580ead722</guid><dc:creator>ftjandra</dc:creator><description>&lt;p&gt;Is this now supported in SDK16.0 (scan + burst)? If not, what modifications need to be done and where. I don&amp;#39;t think&amp;nbsp;nrf_drv_saadc.c exists anymore.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saacd scan oversample</title><link>https://devzone.nordicsemi.com/thread/104879?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2017 17:58:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97e22225-ebce-4840-9ecf-1fce66e47495</guid><dc:creator>Jason Hendrix</dc:creator><description>&lt;p&gt;Thanks Jorgen, that works perfectly for me.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saacd scan oversample</title><link>https://devzone.nordicsemi.com/thread/104878?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2017 12:09:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c3b4201-7c45-4b83-9270-2ffc7d1f8e02</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi Jason,&lt;/p&gt;
&lt;p&gt;As described by Carsten in the thread you are linking, oversample will give correct sampling in scan mode only when burst is enabled for all active channels.&lt;/p&gt;
&lt;p&gt;Unfortunately, this is not supported by the SAADC driver in the SDK. It should however be quite simple to add this support if you want to use it. These instructions are for SDK 14.1.0, all changes in &lt;em&gt;nrf_drv_saadc.c&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;Add an array called &lt;code&gt;burst&lt;/code&gt; to the struct &lt;code&gt;nrf_drv_saadc_cb_t&lt;/code&gt;, to keep track of the burst settings for each channel (add between line 93-94):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint8_t burst[NRF_SAADC_CHANNEL_COUNT];    ///&amp;lt; Burst configurations of SAADC channels.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Add a check to make sure all enabled channels have burst enabled, in &lt;code&gt;nrf_drv_saadc_channel_init()&lt;/code&gt; (replace line 314-316):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Oversampling can be used with only one channel, or if burst is enabled for all active channels.
uint8_t allow_oversample = true;
if(m_cb.active_channels != 0)
{
	for(int i = 0; i &amp;lt; NRF_SAADC_CHANNEL_COUNT; i++)
	{
		if ((m_cb.psel[i].pselp != NRF_SAADC_INPUT_DISABLED) &amp;amp;&amp;amp; m_cb.burst[i] != NRF_SAADC_BURST_ENABLED)
		{
			allow_oversample = false;
		}
	}
	if(allow_oversample &amp;amp;&amp;amp; p_config-&amp;gt;burst == NRF_SAADC_BURST_DISABLED)
	{
		allow_oversample = false;
	}
}
ASSERT((nrf_saadc_oversample_get() == NRF_SAADC_OVERSAMPLE_DISABLED) || allow_oversample);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Store burst setting in struct before initializing the channel in &lt;code&gt;nrf_drv_saadc_channel_init()&lt;/code&gt; (add between line 344-345):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;m_cb.burst[channel] = p_config-&amp;gt;burst;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Clear burst setting in struct when uninitializing channel in &lt;code&gt;nrf_drv_saadc_channel_uninit()&lt;/code&gt; (add between line 383-384):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;m_cb.burst[channel] = NRF_SAADC_BURST_DISABLED;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I will report this internally, hopefully we can make the driver support this.&lt;/p&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></channel></rss>