<?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 BURST problems in scan vs non-scan acquisitions</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/45339/saadc-burst-problems-in-scan-vs-non-scan-acquisitions</link><description>I&amp;#39;m using the SAADC peripheral by controlling its registers directly (no SDK or MDK HAL). I have an application that alternates between two configurations: 
 * One sample from AIN1 * A sample from AIN4 followed by a sample from AIN5 
 Reduced reproducing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Apr 2019 06:27:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/45339/saadc-burst-problems-in-scan-vs-non-scan-acquisitions" /><item><title>RE: SAADC BURST problems in scan vs non-scan acquisitions</title><link>https://devzone.nordicsemi.com/thread/181980?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 06:27:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd3fd550-64d4-46db-ba49-590531c84fe7</guid><dc:creator>Jakub Rzeszutko</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry I didn&amp;#39;t comment on your observation earlier but we&amp;#39;re still working on the PAN-212. There&amp;#39;s a chance that we will have a solution to not lose calibration data. We need some more time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC BURST problems in scan vs non-scan acquisitions</title><link>https://devzone.nordicsemi.com/thread/181962?ContentTypeID=1</link><pubDate>Sun, 14 Apr 2019 12:35:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb56031c-095f-4d65-99ee-36a521296bf9</guid><dc:creator>pabigot</dc:creator><description>&lt;p&gt;To collect the full set of information:&lt;/p&gt;
&lt;p&gt;Yes, mixing BURST+OVERSAMPLE and moving between scan-mode and one-shot SAADC causes problems that will be PAN-212.&amp;nbsp; The workaround is &lt;a title="PAN-212 workaround" href="https://devzone.nordicsemi.com/f/nordic-q-a/45339/saadc-burst-problems-in-scan-vs-non-scan-acquisitions/178435#178435"&gt;described in this response&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;However, the workaround clears the SAADC calibration, as &lt;a title="workaround clears calibration" href="https://devzone.nordicsemi.com/f/nordic-q-a/45339/saadc-burst-problems-in-scan-vs-non-scan-acquisitions/179953#179953"&gt;confirmed in this response&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Calibration is a one-shot measurement.&amp;nbsp; Because both calibration and oversampling are &lt;a title="noise" href="https://devzone.nordicsemi.com/f/nordic-q-a/12287/nrf52-saadc-noise/46445#46445"&gt;important for repeatable accurate SAADC results&lt;/a&gt;, correct placement of the workaround is probably application-dependent (e.g., issue it before performing any calibration, and then never transition from scan-mode back to one-shot without repeating the power-cycle + calibrate sequence).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC BURST problems in scan vs non-scan acquisitions</title><link>https://devzone.nordicsemi.com/thread/179953?ContentTypeID=1</link><pubDate>Wed, 03 Apr 2019 11:01:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14b361e6-bee5-4015-952d-b68213f04bba</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You are right. The 0xFFC register controls the power to the SAADC peripheral, and the peripheral and its registers will be reset to its initial state by switching the peripheral off and then back on again. This includes the calibration.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC BURST problems in scan vs non-scan acquisitions</title><link>https://devzone.nordicsemi.com/thread/179342?ContentTypeID=1</link><pubDate>Sat, 30 Mar 2019 14:55:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69044002-e8f9-40a4-8248-86b1693e80f1</guid><dc:creator>pabigot</dc:creator><description>&lt;p&gt;Thanks, I&amp;#39;ve confirmed that works, but have a question:&lt;/p&gt;
&lt;p&gt;This appears to power-cycle the SAADC peripheral (that being the role of 0xFFC within other peripherals). I&amp;#39;ve confirmed that although INTEN appears to be preserved, the sequence clears the CH[i], RESOLUTION, OVERSAMPLE, and RESULT registers (didn&amp;#39;t test SAMPLERATE).&lt;/p&gt;
&lt;p&gt;Is SAADC calibration affected by this sequence?&lt;/p&gt;
&lt;p&gt;If so, this workaround may not be useful in my applications since I&amp;#39;d hoped to only have to calibrate when the temperature changed, not before every acquisition.&lt;/p&gt;
&lt;p&gt;[Later: Testing suggests the undocumented registers at 0x62C and 0x630 are&amp;nbsp;affected by&amp;nbsp;calibration.&amp;nbsp; The workaround does&amp;nbsp;reset those registers.]&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC BURST problems in scan vs non-scan acquisitions</title><link>https://devzone.nordicsemi.com/thread/179207?ContentTypeID=1</link><pubDate>Fri, 29 Mar 2019 11:39:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6e34630-9125-424f-a13e-2d128bd14e13</guid><dc:creator>Jakub Rzeszutko</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Problem you have observed is hardware related and we will shortly release PAN-212 for that.&lt;/p&gt;
&lt;p&gt;You should execute following code before changing channel configuration:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;*(volatile uint32_t *)0x40007FFC = 0;
*(volatile uint32_t *)0x40007FFC = 1;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC BURST problems in scan vs non-scan acquisitions</title><link>https://devzone.nordicsemi.com/thread/178435?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2019 14:48:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bec84dfd-a54a-48b8-97f1-1e9b307f8667</guid><dc:creator>pabigot</dc:creator><description>&lt;p&gt;Thanks.&amp;nbsp; On further testing the workaround I had hopes for fails: triggering additional TASKS_SAMPLE from within the interrupt doesn&amp;#39;t do the right thing in scan mode, as all results are taken from the first enabled channel.&amp;nbsp; As best I can tell there&amp;#39;s no way to do oversampling in scan mode if you also do collections in one-shot mode.&amp;nbsp; Unless there&amp;#39;s a hidden task that would kick off a second conversion without resetting the channel index, which would be really nice....&lt;/p&gt;
&lt;p&gt;(Correction: oversampling in scan mode takes one sample from each channel for each issued TASKS_SAMPLE.&amp;nbsp; So if OVERSAMPLE=1 and two channels are enabled you get two values as expected, but they&amp;#39;re the average of the readings from the enabled channels: instead of thermistors reading 20 Cel and 30 Cel, you get two thermistors reading 25 Cel.&amp;nbsp; Not very useful.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC BURST problems in scan vs non-scan acquisitions</title><link>https://devzone.nordicsemi.com/thread/178379?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2019 13:24:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83ea1cbe-be16-43ce-96a9-81f09d3c96c7</guid><dc:creator>Jakub Rzeszutko</dc:creator><description>&lt;p&gt;Thank you for update, we will investigate your example. I will try to give you an update by end of this week - latest on Monday.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC BURST problems in scan vs non-scan acquisitions</title><link>https://devzone.nordicsemi.com/thread/178360?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2019 13:02:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4e39d69-5f56-4543-9f38-4ca5aa0cad81</guid><dc:creator>pabigot</dc:creator><description>&lt;p&gt;I updated the example to disable all channels, which appears to be the only difference between our solutions, and to dump the ADC state after the successful completions showing that all events are cleared.&amp;nbsp; The &lt;a href="https://gist.github.com/pabigot/10775b4d62ee2edec36b51ec448e7f76#file-output-txt"&gt;problem remains&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC BURST problems in scan vs non-scan acquisitions</title><link>https://devzone.nordicsemi.com/thread/178338?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2019 12:35:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a25f55f-5601-41a8-bac0-0adf9e214760</guid><dc:creator>Jakub Rzeszutko</dc:creator><description>&lt;p&gt;It might be not enough. May you please ensure that all events are stopped, interrupts deactivated and all channels uninitialized?&lt;/p&gt;
&lt;p&gt;Please take a look at our implementation:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/NordicSemiconductor/nrfx/blob/master/drivers/src/nrfx_saadc.c#L250"&gt;https://github.com/NordicSemiconductor/nrfx/blob/master/drivers/src/nrfx_saadc.c#L250&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC BURST problems in scan vs non-scan acquisitions</title><link>https://devzone.nordicsemi.com/thread/178324?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2019 11:58:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9664296-002f-4167-aeb6-bbfda2a86234</guid><dc:creator>pabigot</dc:creator><description>&lt;p&gt;AFAICT that&amp;#39;s exactly what I do by &lt;a href="https://gist.github.com/pabigot/10775b4d62ee2edec36b51ec448e7f76#file-example-cc-L180"&gt;writing 0 to SAADC.ENABLE&lt;/a&gt; after receiving EVENTS_STOPPED in the example.&amp;nbsp; It does not resolve the problem&lt;/p&gt;
&lt;p&gt;If there&amp;#39;s a stronger version of power-cycle (used to be some peripherals that had a hidden register) I&amp;#39;d be happy to try that, but I need more details.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC BURST problems in scan vs non-scan acquisitions</title><link>https://devzone.nordicsemi.com/thread/178240?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2019 08:02:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86bf5b8f-6bba-4fae-b063-f1ed629fd259</guid><dc:creator>Jakub Rzeszutko</dc:creator><description>&lt;p&gt;Hi pabigot,&lt;/p&gt;
&lt;p&gt;Currently we are investigating similar issue. May you please try to execute power cycle of SAADC after each configuration change?&lt;/p&gt;
&lt;p&gt;I mean try following approach:&lt;/p&gt;
&lt;p&gt;1. configure SAADC for 1 sample on AIN1&lt;/p&gt;
&lt;p&gt;2. Measure a value&lt;/p&gt;
&lt;p&gt;3. Uninint / switch off SAADC completely&lt;/p&gt;
&lt;p&gt;4. Init SAADC for AIN4-AIN5&lt;/p&gt;
&lt;p&gt;5. Measure values&lt;/p&gt;
&lt;p&gt;6. Uninint / switch off SAADC completely&lt;br /&gt;start again...&lt;/p&gt;
&lt;p&gt;This shall help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>