<?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>Two saadc channels get switched if callback takes too long</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/48831/two-saadc-channels-get-switched-if-callback-takes-too-long</link><description>I&amp;#39;m trying to read two ADC channels asynchronously. 
 I can setup two channels, and as mentioned on the forums , the data from channel 0 is at buffer[0]. 
 
 The issue I&amp;#39;m trying to understand is that if there is a delay in the saadc_callback, channel</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 21 Jun 2019 14:11:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/48831/two-saadc-channels-get-switched-if-callback-takes-too-long" /><item><title>RE: Two saadc channels get switched if callback takes too long</title><link>https://devzone.nordicsemi.com/thread/194140?ContentTypeID=1</link><pubDate>Fri, 21 Jun 2019 14:11:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a03355a-3845-4f9b-affc-8e470826c5c7</guid><dc:creator>mtfurlan_t</dc:creator><description>&lt;p&gt;Yep, that is the issue.&lt;/p&gt;
&lt;p&gt;I got it working from comments in that thread.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Working diff:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="diff"&gt;diff --git a/examples/peripheral/saadc/main.c b/examples/peripheral/saadc/main.c
index 8c956541..d80e9731 100644
--- a/examples/peripheral/saadc/main.c
+++ b/examples/peripheral/saadc/main.c
@@ -72,6 +72,7 @@ volatile uint8_t state = 1;
 static const nrf_drv_timer_t m_timer = NRF_DRV_TIMER_INSTANCE(0);
 static nrf_saadc_value_t     m_buffer_pool[2][SAMPLES_IN_BUFFER];
 static nrf_ppi_channel_t     m_ppi_channel;
+static nrf_ppi_channel_t     m_ppi_channel0;
 static uint32_t              m_adc_evt_counter;
 
 
@@ -110,17 +111,27 @@ void saadc_sampling_event_init(void)
     err_code = nrf_drv_ppi_channel_alloc(&amp;amp;m_ppi_channel);
     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_assign(m_ppi_channel,
                                           timer_compare_event_addr,
                                           saadc_sample_task_addr);
     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);
+
 }
 
 
 void saadc_sampling_event_enable(void)
 {
     ret_code_t err_code = nrf_drv_ppi_channel_enable(m_ppi_channel);
-
+    APP_ERROR_CHECK(err_code);
+    err_code = nrf_drv_ppi_channel_enable(m_ppi_channel0);
     APP_ERROR_CHECK(err_code);
 }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Two saadc channels get switched if callback takes too long</title><link>https://devzone.nordicsemi.com/thread/194098?ContentTypeID=1</link><pubDate>Fri, 21 Jun 2019 12:12:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a92b2ae8-b195-463e-8ddc-d7937cf3e151</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Please have a look at &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/20291/offset-in-saadc-samples-with-easy-dma-and-ble/79053#79053"&gt;my answer in this post&lt;/a&gt;.&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>