<?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 Sampling Issue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/55426/saadc-sampling-issue</link><description>Hello, 
 I am trying to sample and reconstruct an audio signal using the SAADC and I2S respectively. I have a double buffer setup for the SAADC, where we process the data in one buffer while sampling in the other, but I am getting discontinuities in the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 11 Dec 2019 21:21:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/55426/saadc-sampling-issue" /><item><title>RE: SAADC Sampling Issue</title><link>https://devzone.nordicsemi.com/thread/225037?ContentTypeID=1</link><pubDate>Wed, 11 Dec 2019 21:21:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25670817-db08-4e29-a68c-b95db2a0ab2e</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Do you have a sample application that you can share, which we can use to reproduce the behavior?&lt;/p&gt;
&lt;p&gt;If you could also post the buffer with all the SAADC samples when this glitch happens, it would help with finding the root cause.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC Sampling Issue</title><link>https://devzone.nordicsemi.com/thread/224825?ContentTypeID=1</link><pubDate>Wed, 11 Dec 2019 01:06:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0580d015-48f7-4c5b-859e-96f61f2929aa</guid><dc:creator>rkb</dc:creator><description>&lt;p&gt;Hi J&lt;span&gt;&amp;oslash;rgen,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I tried both of those suggestions, and I couldn&amp;#39;t get a working solution. Moving nrf_drv_saadc_buffer_convert() call didn&amp;#39;t seem to have an effect, likely since the buffer processing time is still shorter than the time it takes for the secondary buffer to fill up. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Moving the buffer processing outside of the interrupt handler to the timer handlers didn&amp;#39;t seem to resolve the issue as well; there is still a small glitch in the output buffer that lines up with everytime the saadc_handler()&amp;nbsp;gets past the if statement (I tested this by toggling a GPIO everytime the if statement in the interrupt handler was true). I am thinking&amp;nbsp;&lt;em&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Let me know if you have any other suggestions about this issue, and thank you for your advice!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC Sampling Issue</title><link>https://devzone.nordicsemi.com/thread/224741?ContentTypeID=1</link><pubDate>Tue, 10 Dec 2019 13:02:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c67937d-0e72-4782-a4d5-5d5e999519d4</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;How does the buffer look when it is filled with the failing samples? Have you tried moving the processing of the buffer outside of the interrupt handler/callback handler (possibly copy the content to a third buffer or using a third buffer to allow double buffering and processing of one buffer)? I would also recommend that you move the&amp;nbsp;nrf_drv_saadc_buffer_convert() call after you have processed/copied the buffer. Calling this function will trigger the START task, allowing the SAADC peripheral to overwrite the buffer while you process it.&lt;/p&gt;
&lt;p&gt;There is a &lt;a href="https://github.com/NordicSemiconductor/nrfx/blob/master/drivers/src/nrfx_saadc.c"&gt;new SAADC driver&lt;/a&gt; coming in NRFX that will handle double buffering pointer updates better, and provide more advanced features, but unfortunately, we do not provide any examples of this yet as it is not integrated into the SDK.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>