<?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 read the same ADC channel multiple times in a very short time in the app timer timeout callback function?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/56133/how-to-read-the-same-adc-channel-multiple-times-in-a-very-short-time-in-the-app-timer-timeout-callback-function</link><description>Hi, I&amp;#39;m using nrf52832, sdk15.3. I have 4 pressure sensors connected to a multiplexer (MUX) chip. And the output of the MUX is connected to channel A0 of the nrf52832. I use an app timer to trigger the ADC sampling manually. The tick equals 1000 ms, </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 06 Jan 2020 09:01:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/56133/how-to-read-the-same-adc-channel-multiple-times-in-a-very-short-time-in-the-app-timer-timeout-callback-function" /><item><title>RE: How to read the same ADC channel multiple times in a very short time in the app timer timeout callback function?</title><link>https://devzone.nordicsemi.com/thread/227601?ContentTypeID=1</link><pubDate>Mon, 06 Jan 2020 09:01:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:852e092b-3922-4f04-b760-dd72ebe4ae4f</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Glad to hear that solved your problem, and yes, it was much likely a interrupt priority issue.&lt;/p&gt;
&lt;p&gt;The recommendation to use app scheduler was meant for the whole application. Please be aware there is a known limitation with the app timer, see here: &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/34155/what-are-sdk-15-x-0-known-issues"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/34155/what-are-sdk-15-x-0-known-issues&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Linking to the overview for reference, search for app_timer to fine the limitation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read the same ADC channel multiple times in a very short time in the app timer timeout callback function?</title><link>https://devzone.nordicsemi.com/thread/227505?ContentTypeID=1</link><pubDate>Fri, 03 Jan 2020 22:21:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c866ac59-7de2-4bde-97bc-7c82aa345a9c</guid><dc:creator>w52918</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I used the scheduler to do it, and everything works fine! Thanks!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I think it&amp;#39;s priority problem that app timer has higher priority than ADC. That&amp;#39;s why adc callback function only called one time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read the same ADC channel multiple times in a very short time in the app timer timeout callback function?</title><link>https://devzone.nordicsemi.com/thread/227492?ContentTypeID=1</link><pubDate>Fri, 03 Jan 2020 19:28:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60230a28-39e7-4c02-ac8e-ada003e62233</guid><dc:creator>w52918</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When you say app scheduler, you mean I can use it for all tasks or just for reading the 4 pressure sensors.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And&amp;nbsp;u&lt;span&gt;_adc_start_sampling() does nothing but just calls&amp;nbsp;nrf_drv_saadc_sample().&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void u_adc_start_sampling(void) {
    nrf_drv_saadc_sample();
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Should I manually clear the ADC busy flag or something?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read the same ADC channel multiple times in a very short time in the app timer timeout callback function?</title><link>https://devzone.nordicsemi.com/thread/227420?ContentTypeID=1</link><pubDate>Fri, 03 Jan 2020 13:21:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b3806ac-2400-425f-817a-d128373bec11</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Have you considered using the app scheduler instead? i.e. this way you can keep your interrupt routines short and do the work in main context after you exit the interrupt?&lt;/p&gt;
&lt;p&gt;Also not sure what you do in µ_adc_start_sampling();&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>