<?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>Sampling two analog signals using SAADC at two different rate</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15882/sampling-two-analog-signals-using-saadc-at-two-different-rate</link><description>Hi, 
 I am working on one application in which I want to sample ECG at 1000 samples per second continuously and battery value at 15 seconds interval. I am configuring two channels of SAADC two do this task. but as there only one callback function I can</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 Mar 2020 14:29:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15882/sampling-two-analog-signals-using-saadc-at-two-different-rate" /><item><title>RE: Sampling two analog signals using SAADC at two different rate</title><link>https://devzone.nordicsemi.com/thread/237808?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 14:29:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d99d2cab-c60d-49a2-a71c-834d010d13bd</guid><dc:creator>jawadk</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have some questions about this.&lt;/p&gt;
&lt;p&gt;First we need to initialize all the channels yes&amp;nbsp;in the ADC initialization as the example in the SDK!?&lt;/p&gt;
&lt;p&gt;Then we can enable or disable a specific channel using the following function:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;nrf_saadc_channel_pos_input_set(0, NRF_SAADC_INPUT_DISABLED); // to disable channel 0
    
    
nrf_saadc_channel_pos_input_set(0, NRF_SAADC_INPUT_AIN0);  // to enable channel 0
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;when I enable the channel using the above function while the ADC is running I will receive automatically the sample from this channel in the ADC callback ?&lt;/p&gt;
&lt;p&gt;Regarding the&amp;nbsp;&lt;span&gt;RESULT.MAXCNT, I don&amp;#39;t need to change it since I initialized all the channels yes ? ( just after the initialization I disabled the channel I need to sample in less rate), or I still need to increase&amp;nbsp;and decrease this parameter every time ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;when channel 1 is enabled and channel 0 is disabled, I will receive the sample of channel 1 in the first index of the buffer or in the second !?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&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;Jawad Khaleel&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sampling two analog signals using SAADC at two different rate</title><link>https://devzone.nordicsemi.com/thread/60578?ContentTypeID=1</link><pubDate>Tue, 23 Aug 2016 11:52:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:069de978-2857-4578-a964-dbbaf02c2760</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;This is not trivial using the driver, so I will try to explain how it should work with the SAADC peripheral.&lt;/p&gt;
&lt;p&gt;You can enable or disable a channel by configuring the PSELP field, as the specification says:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A channel is considered enabled if
CH[n].PSELP is set. If more than one
channel, CH[n], is enabled, the ADC
enters scan mode.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Enable the battery measurement channel every 15000 ECG sample and disable it when you have received the measurement.&lt;/p&gt;
&lt;p&gt;You also have to configure RESULT.MAXCNT to allow for two samples to be stored in RAM when you enable the battery measurement channel.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>