<?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>How to sample the SAADC at 200Khz?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86643/how-to-sample-the-saadc-at-200khz</link><description>We are porting to the nrf52832 an application that needs to sample the SAADC continuously at 200Khz (alternating between two inputs) with dual buffering DMA of let&amp;#39;s say 1k samples each and having each completed buffer processed by a computation logic</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 08 Apr 2022 08:55:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86643/how-to-sample-the-saadc-at-200khz" /><item><title>RE: How to sample the SAADC at 200Khz?</title><link>https://devzone.nordicsemi.com/thread/362526?ContentTypeID=1</link><pubDate>Fri, 08 Apr 2022 08:55:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e166d86e-3b8b-481c-af8f-806bbdc44cd2</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Yes, if everything should go through PPI, that would be the maximum. You may get away with lower Tacq if you have large enough buffers and can guarantee that you will not be interrupted by something else, and can trigger the START task from the application. The buffer pointer can be changed and TASKS_START can be triggered as soon as the EVENTS_STARTED is generated. May need some thorough testing though.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to sample the SAADC at 200Khz?</title><link>https://devzone.nordicsemi.com/thread/362466?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2022 23:47:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e2a1d82-56d7-44c9-b621-7688f769bb3f</guid><dc:creator>zapta</dc:creator><description>&lt;p&gt;Thanks Amanda, this is very useful, especially the errata.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s see if we go it right. What we need to do requires scan mode (alternate samples between two inputs), ppi (for proper DMA double buffering) and tAcq should be at least 10us (I presume this is the next step after 5us) which results at a sampling speed of&amp;nbsp; &amp;nbsp;1s/(10us + 2us) =&amp;nbsp;&amp;nbsp;83Khz or 41Khz for each of the two scanned inputs. This is less than half of the expected 200khz.&lt;/p&gt;
&lt;p&gt;Is it so?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to sample the SAADC at 200Khz?</title><link>https://devzone.nordicsemi.com/thread/362204?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2022 06:41:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:786a41d7-6569-4de1-be5f-e3cbfad771dd</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;200ksps is the maximum sample frequency supported by the SAADC, so this will only work for 1 channel. If you need to sample two channels (e.g. in SCAN mode), 100ksps is the maximum that can be achieved. If you sample 1 channel at a time and switch to another channel sometime in the future, there should be no problems, apart from the obvious that there will be a short delay in sampling when switching channel.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Maximum sample rate requires lowest acquisition time, which limits the supported source resistance (see table 2:&amp;nbsp;&lt;/span&gt;&lt;a title="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/saadc.html?cp=4_2_0_36_8#concept_qh3_spp_qr" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/saadc.html?cp=4_2_0_36_8#concept_qh3_spp_qr" rel="noopener noreferrer" target="_blank"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/saadc.html?cp=4_2_0_36_8#concept_qh3_spp_qr&lt;/a&gt;&lt;span&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;ACQ=3us also enables lots of erratas in nRF52832, which they need to consider:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a title="https://infocenter.nordicsemi.com/topic/errata_nrf52832_rev3/err/nrf52832/rev3/latest/anomaly_832_74.html#anomaly_832_74" href="https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev3/ERR/nRF52832/Rev3/latest/anomaly_832_74.html#anomaly_832_74" rel="noopener noreferrer" target="_blank"&gt;&lt;span&gt;Started events fires prematurely&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;a title="https://infocenter.nordicsemi.com/topic/errata_nrf52832_rev3/err/nrf52832/rev3/latest/anomaly_832_150.html#anomaly_832_150" href="https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev3/ERR/nRF52832/Rev3/latest/anomaly_832_150.html#anomaly_832_150" rel="noopener noreferrer" target="_blank"&gt;&lt;span&gt;EVENT_STARTED does not fire&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;a title="https://infocenter.nordicsemi.com/topic/errata_nrf52832_rev3/err/nrf52832/rev3/latest/anomaly_832_178.html#anomaly_832_178" href="https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev3/ERR/nRF52832/Rev3/latest/anomaly_832_178.html#anomaly_832_178" rel="noopener noreferrer" target="_blank"&gt;&lt;span&gt;END event firing too early&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;a title="https://infocenter.nordicsemi.com/topic/errata_nrf52832_rev3/err/nrf52832/rev3/latest/anomaly_832_212.html#anomaly_832_212" href="https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev3/ERR/nRF52832/Rev3/latest/anomaly_832_212.html#anomaly_832_212" rel="noopener noreferrer" target="_blank"&gt;&lt;span&gt;Events are not generated when switching from scan mode to no-scan mode with burst enabled&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are more erratas, but these are specific to TACQ=3us&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You can either use PPI with the nrfx_saadc driver (preferably v2 API), or using the internal SAMPLERATE register for&amp;nbsp;&lt;/span&gt;&lt;a title="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/saadc.html?cp=4_2_0_36_4_1#saadc_operationmodes_continuous" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/saadc.html?cp=4_2_0_36_4_1#saadc_operationmodes_continuous" rel="noopener noreferrer" target="_blank"&gt;Continuous mode&lt;/a&gt;&lt;span&gt;&amp;nbsp;sampling. Also see &lt;a href="https://devzone.nordicsemi.com/support-private/support/287108/Link%20them%20to%20this%20as%20well:%20https:/devzone.nordicsemi.com/f/nordic-q-a/20291/offset-in-saadc-samples-with-easy-dma-and-ble/79053#79053"&gt;this case&lt;/a&gt;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Not sure if your goal can be achieved, considering the second errata I linked and the need for using PPI to connect END-&amp;gt;START to avoid buffer swapping.&amp;nbsp;&lt;/span&gt;&lt;span&gt;If you use one channel it should not be a problem.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>