<?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 ADC channels at 16 kHz</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/113103/sampling-two-adc-channels-at-16-khz</link><description>Hi, 
 I&amp;#39;m trying to implement an application that acquires data from two channels of the SAADC in &amp;quot;parallel&amp;quot;. I&amp;#39;m currently using the nRF52 DK and nRF5 SDK v17.1.0. After reading several post on DevZone and some examples on Github, I developed the code</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 06 Aug 2024 15:29:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/113103/sampling-two-adc-channels-at-16-khz" /><item><title>RE: Sampling two ADC channels at 16 kHz</title><link>https://devzone.nordicsemi.com/thread/497209?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2024 15:29:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31dc43fd-e404-4466-8f05-81fb5af8abe2</guid><dc:creator>Maria Gilje</dc:creator><description>&lt;p&gt;Hi Moritz,&lt;/p&gt;
&lt;p&gt;Thank you for your patience with this.&lt;/p&gt;
&lt;p&gt;The SAADC has a scan mode where one SAMPLE task triggers one conversion for each enabled channel. The ADC will automatically enter scan mode when more than one channel is enabled. This mode will remove the problem with a new task starting before the channel can be switched manually.&lt;/p&gt;
&lt;p&gt;See the Scan mode documentation in the nRF52832 PS &lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf52832/page/saadc.html#d944e375"&gt;here&lt;/a&gt;. The samples for each channel will alternate in the buffer when using two channels, and appear in repeated sampling order when using more than two.&lt;/p&gt;
&lt;p&gt;Another reference which enables scan mode is this sample at the NordicPlayground GitHub repository: &lt;a href="https://devzone.nordicsemi.com/support-private/support/330153/ble_app_uart__saadc_timer_driven__scan_mode%20example"&gt;https://github.com/NordicPlayground/nRF52-ADC-examples/tree/master/ble_app_uart__saadc_timer_driven__scan_mode&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Maria&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sampling two ADC channels at 16 kHz</title><link>https://devzone.nordicsemi.com/thread/495684?ContentTypeID=1</link><pubDate>Thu, 25 Jul 2024 15:45:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b58ae331-0eb8-4c02-a578-4ecbcd1975f0</guid><dc:creator>Moritz_S</dc:creator><description>&lt;p&gt;Hi, thanks for the feedback. I know about this function, but I&amp;#39;m not sure how it will help my application. I want to sample at 16 kHz basically &amp;quot;in parallel&amp;quot;. That means after getting the ADC_EVT_DONE, I must switch the channel. I thought about that more, and I guess the timer triggers the next ADC TASK_SAMPLE before I can convert the buffer and switch the channel. So I thought about stopping the timer when getting ADC_EVT_DONE, switch to the other channel and start the timer again. The examples I saw do not do that and it sounds a little tedious to me, but this should keep the ADC from being busy while switching the channel. what do you think?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sampling two ADC channels at 16 kHz</title><link>https://devzone.nordicsemi.com/thread/494846?ContentTypeID=1</link><pubDate>Fri, 19 Jul 2024 14:30:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36d87229-2a14-4b6a-b036-6229cfca1af3</guid><dc:creator>Maria Gilje</dc:creator><description>&lt;p&gt;Hello again,&lt;/p&gt;
&lt;p&gt;I got a simple idea while working on this today:&lt;/p&gt;
&lt;p&gt;You could possibly use the &lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/group__nrfx__saadc.html#gada73390989901a284e9d52621639763e"&gt;nrfx_saadc_is_busy&lt;/a&gt;() function as a way to only uninit after the SAADC is ready.&lt;/p&gt;
&lt;p&gt;Unfortunately I have not had time to test it.&lt;/p&gt;
&lt;p&gt;Let me know when you have tried it out and we&amp;#39;ll go from there.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Maria&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sampling two ADC channels at 16 kHz</title><link>https://devzone.nordicsemi.com/thread/494629?ContentTypeID=1</link><pubDate>Thu, 18 Jul 2024 15:06:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a216cfc-083b-4d90-82d6-9433e8f0def4</guid><dc:creator>Maria Gilje</dc:creator><description>&lt;p&gt;Hello, &lt;/p&gt;
&lt;p&gt;I just want to let you know that I will address this tomorrow. Thank you for your patience.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Maria&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>