<?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 predict how much CPU time the SAADC needs on the nRF52832?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43299/how-to-predict-how-much-cpu-time-the-saadc-needs-on-the-nrf52832</link><description>I&amp;#39;m attempting to get a grasp on how much CPU time an SAADC conversion is taking. I&amp;#39;m running the SAADC sample code from the nRF52 v15.1.0 SDK on an nRF52832. SAADC_CONFIG_RESOLUTION is set to 10. SAADC_CONFIG_LP_MODE is not enabled. SAADC_CONFIG_IRQ_PRIORITY</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 07 Feb 2019 13:40:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43299/how-to-predict-how-much-cpu-time-the-saadc-needs-on-the-nrf52832" /><item><title>RE: How to predict how much CPU time the SAADC needs on the nRF52832?</title><link>https://devzone.nordicsemi.com/thread/169933?ContentTypeID=1</link><pubDate>Thu, 07 Feb 2019 13:40:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0820b6aa-8d80-4e6e-844c-315df208eefa</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;most probably you are using the burst mode then. I am not sure if the oversampling rate is linearly proportional to the time it takes to finish the full samples. But it definitely seems to take more. Here is the text from the PS&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;The accumulator is controlled in the OVERSAMPLE register. The SAMPLE task must be set 2OVERSAMPLE number of times before the result is written to RAM. This can be achieved by:

Configuring a fixed sampling rate using the local timer or a general purpose timer and PPI to trigger a SAMPLE task
Triggering SAMPLE 2OVERSAMPLE times from software
Enabling BURST mode
CH[n].CONFIG.BURST can be enabled to avoid setting SAMPLE task 2OVERSAMPLE times. With BURST = 1 the ADC will sample the input 2OVERSAMPLE times as fast as it can (actual timing: &amp;lt;(tACQ+tCONV)&amp;#215;2OVERSAMPLE). Thus, for the user it will just appear like the conversion took a bit longer time, but other than that, it is similar to one-shot mode.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If you have enabled Burst mode, then it seems that taking more time for the whole sample to finish seems reasonable.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to predict how much CPU time the SAADC needs on the nRF52832?</title><link>https://devzone.nordicsemi.com/thread/169620?ContentTypeID=1</link><pubDate>Wed, 06 Feb 2019 04:11:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8023488-c1b7-4f65-9104-988becc17fc0</guid><dc:creator>heehaw</dc:creator><description>&lt;p&gt;In the main loop of the SAADC sample, I&amp;#39;ve added a toggle of GPIO 24:&lt;/p&gt;
&lt;p&gt;while (1)&lt;br /&gt; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; nrf_pwr_mgmt_run();&lt;br /&gt;&amp;nbsp; &amp;nbsp; NRF_LOG_FLUSH();&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; nrf_gpio_pin_toggle(24);&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;In saadc_sampling_event_init() of the SAADC sample, I&amp;#39;ve set the PPI timer to 1ms:&lt;/p&gt;
&lt;p&gt;/* setup m_timer for compare event every 1ms */&lt;br /&gt; uint32_t ticks = nrf_drv_timer_ms_to_ticks(&amp;amp;m_timer, 1);&lt;/p&gt;
&lt;p&gt;With this setup, GPIO 24 in the main loop toggles every 1 ms. If I set oversampling from OFF to 2x, GPIO 24 toggles every 2ms. If I set oversampling to 4x, GPIO 24 toggles every 4 ms. As I understand it, the SAADC sample is non-blocking, so I would expect GPIO 24 to toggle as fast as possible, and not be directly related to the SAADC configuration.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to predict how much CPU time the SAADC needs on the nRF52832?</title><link>https://devzone.nordicsemi.com/thread/169272?ContentTypeID=1</link><pubDate>Mon, 04 Feb 2019 10:49:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ad9c21b-8472-4dd4-895b-9105cf4876c7</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I am not sure how you are toggling the GPIOs but SAADC is a peripheral with its own EasyDMA, the CPU usage should be only to configure the peripheral and process any callbacks. It would give us a better view if we see exactly where you are toggling the GPIOs&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>