<?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 oversampling + burst mode on three channel</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81539/saadc-oversampling-burst-mode-on-three-channel</link><description>Hi, 
 Sorry, I accidentally closed my last question and I don&amp;#39;t know how to reopen it. So I create a new one to need your support. 
 I want to use 200ms to get ADC value from three channel and I want to get 30 times ADC value from every channel when 200ms</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 11 Nov 2021 05:33:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81539/saadc-oversampling-burst-mode-on-three-channel" /><item><title>RE: SAADC oversampling + burst mode on three channel</title><link>https://devzone.nordicsemi.com/thread/338468?ContentTypeID=1</link><pubDate>Thu, 11 Nov 2021 05:33:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f81ed0c2-ed71-4411-9280-4c3fd42d0c78</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Good Luck Jon!&lt;/p&gt;
&lt;p&gt;BR&lt;/p&gt;
&lt;p&gt;Kazi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC oversampling + burst mode on three channel</title><link>https://devzone.nordicsemi.com/thread/338462?ContentTypeID=1</link><pubDate>Thu, 11 Nov 2021 03:18:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb6f21ed-0c94-4d94-81e1-18e9c8bd7947</guid><dc:creator>JohnCC</dc:creator><description>&lt;p&gt;Hi Kazi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Thank you for your support. I will take more time to test this solution.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC oversampling + burst mode on three channel</title><link>https://devzone.nordicsemi.com/thread/338409?ContentTypeID=1</link><pubDate>Wed, 10 Nov 2021 14:41:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6618ab8-5510-484b-b092-b604c310b548</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello Jon,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks for your reply. I have looked at your code. Good job as you are getting output from ADC channel according to the arrangement. You have added PPI channel to trigger START from END event, so that may resolve the issue. It is fine.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It is sometimes a bit hard to say if there is any issue just by looking at the part of code. You can test it&amp;nbsp; and feel free to ask us questions if there&amp;nbsp;are any specific issues.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kazi Afroza Sultana&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC oversampling + burst mode on three channel</title><link>https://devzone.nordicsemi.com/thread/338283?ContentTypeID=1</link><pubDate>Wed, 10 Nov 2021 05:42:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c23e906d-d5ee-43a0-9330-9f1751d30a16</guid><dc:creator>JohnCC</dc:creator><description>&lt;p&gt;Hi Kazi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Good news. After i checked this link from you :&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/20291/offset-in-saadc-samples-with-easy-dma-and-ble/79053#79053"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/20291/offset-in-saadc-samples-with-easy-dma-and-ble/79053#79053&lt;/a&gt;&lt;span&gt;&amp;nbsp;and I used PPI function. I fixed my issue. But I need more time to test it.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I pasted my code and please help me to double check it.(Have any problem in my code?)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I add some PPI init code in below function with my timer init&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void timer_init(void)
{
    uint32_t time_ms = 1; //Time(in miliseconds) between consecutive compare events
    uint32_t err_code;
    uint32_t time_ticks;
  
    nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
    err_code = nrf_drv_timer_init(&amp;amp;TIMER_PRIXIMITY, &amp;amp;timer_cfg, timer_proximity_event_handler);
    APP_ERROR_CHECK(err_code);
    
    time_ticks = nrf_drv_timer_ms_to_ticks(&amp;amp;TIMER_PRIXIMITY, time_ms);
    nrf_drv_timer_extended_compare(
         &amp;amp;TIMER_PRIXIMITY, NRF_TIMER_CC_CHANNEL0, time_ticks, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, true);
    
    nrf_drv_timer_enable(&amp;amp;TIMER_PRIXIMITY);
    
    uint32_t timer_compare_event_addr = nrf_drv_timer_compare_event_address_get(&amp;amp;TIMER_PRIXIMITY, NRF_TIMER_CC_CHANNEL0);
    uint32_t saadc_sample_event_addr = nrf_drv_saadc_sample_task_get();

    err_code = nrf_drv_ppi_init();
    APP_ERROR_CHECK(err_code);

    /* setup ppi channel so that timer compare event is triggering sample task in SAADC */
    err_code = nrf_drv_ppi_channel_alloc(&amp;amp;m_ppi_channel);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_drv_ppi_channel_enable(m_ppi_channel);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_drv_ppi_channel_assign(m_ppi_channel, timer_compare_event_addr, saadc_sample_event_addr);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_drv_ppi_channel_alloc(&amp;amp;m_ppi_channel0);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_drv_ppi_channel_enable(m_ppi_channel0);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_drv_ppi_channel_assign(m_ppi_channel0, nrf_saadc_event_address_get(NRF_SAADC_EVENT_END), nrf_saadc_task_address_get(NRF_SAADC_TASK_START));
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;And&amp;nbsp;I haven&amp;#39;t changed anything else&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC oversampling + burst mode on three channel</title><link>https://devzone.nordicsemi.com/thread/338253?ContentTypeID=1</link><pubDate>Tue, 09 Nov 2021 18:25:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51f2bcfa-f2c5-429b-a90f-205f724a23b8</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello John,&lt;/p&gt;
&lt;p&gt;I think you may either move the call to&amp;nbsp;nrf_drv_saadc_sample() after the printf (for printing the current value of variables) and afterward, can start a new sample, or may wait for the SAADC event even handler to be called before printing to get and print new values.&amp;nbsp;To avoid the potential racing you can try this.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Though it depends on what you want to achieve. If triggering occurs before&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;printf&lt;/strong&gt;, there may be a race condition since SAADC buffer may or may not be filled with new samples before&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;pritnf&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;is done printing the variables.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It is recommended to start triggering after offset calibration. If you do offset calibration before starting trigger, the wrong order in the buffer may be caused by this errata:&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a title="https://infocenter.nordicsemi.com/topic/errata_nrf52832_rev3/err/nrf52832/rev3/latest/anomaly_832_86.html?cp=4_2_1_0_1_23" href="https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev3/ERR/nRF52832/Rev3/latest/anomaly_832_86.html?cp=4_2_1_0_1_23" rel="noopener noreferrer" target="_blank"&gt;https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev3/ERR/nRF52832/Rev3/latest/anomaly_832_86.html?cp=4_2_1_0_1_23&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can look at this thread also:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/20291/offset-in-saadc-samples-with-easy-dma-and-ble/79053#79053"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/20291/offset-in-saadc-samples-with-easy-dma-and-ble/79053#79053&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope it helps.&lt;/p&gt;
&lt;p&gt;Best Regards,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kazi Afroza Sultana&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC oversampling + burst mode on three channel</title><link>https://devzone.nordicsemi.com/thread/338040?ContentTypeID=1</link><pubDate>Tue, 09 Nov 2021 03:16:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbed9949-1464-457f-9dc2-98880f2396cb</guid><dc:creator>JohnCC</dc:creator><description>&lt;p&gt;Sorry,&amp;nbsp;I modify the above result&lt;/p&gt;
&lt;p&gt;I expected that the arrangement of the data I printed should be 0-&amp;gt;1-&amp;gt;2&lt;/p&gt;
&lt;p&gt;But It is 2-&amp;gt;0-&amp;gt;1. Why?? Maybe I can use it, but i am confused&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>