<?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>Configuring SAADC on NRF9160 using the lower level driver instead of Zephyr</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51480/configuring-saadc-on-nrf9160-using-the-lower-level-driver-instead-of-zephyr</link><description>I&amp;#39;ve gotten the SAADC working in a blocking fashion and been able to evaluate sample times. Now, I&amp;#39;d like to set it up to automatically read three inputs in a row to see how fast I can get three reads in a row. Something isn&amp;#39;t right. I don&amp;#39;t ever see</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 07 Jan 2020 19:42:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51480/configuring-saadc-on-nrf9160-using-the-lower-level-driver-instead-of-zephyr" /><item><title>RE: Configuring SAADC on NRF9160 using the lower level driver instead of Zephyr</title><link>https://devzone.nordicsemi.com/thread/227992?ContentTypeID=1</link><pubDate>Tue, 07 Jan 2020 19:42:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d1da217-c8ed-4b8b-a438-c76c6b8e2a36</guid><dc:creator>Marciano-PL</dc:creator><description>&lt;p&gt;I misunderstood your answer! It worked perfectly for me. I hadn&amp;#39;t realized that your proposed solution enabled me to use the original nrfx_saadc_event_handler_t the way the api intended. I thought I had to do it differently. Thanks for the help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configuring SAADC on NRF9160 using the lower level driver instead of Zephyr</title><link>https://devzone.nordicsemi.com/thread/227574?ContentTypeID=1</link><pubDate>Mon, 06 Jan 2020 07:39:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4330bc9-e4f2-4c64-922b-5ad2273e4db7</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sorry for the late answer.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;saadc_handler, is that in your main.c? How is that implemented? It should be &amp;quot;void saadc_handler(nrfx_saadc_evt_t const * p_event)&amp;quot;.&lt;/p&gt;
&lt;p&gt;The code posted in my former answer should add the interrupt through zephyr&amp;#39;s APIs, but could it be that the nrfx_saadc needs to be enabled using a preprocessor flag?&lt;/p&gt;
&lt;p&gt;Could you try appending this to your prj.conf?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;CONFIG_COMPILER_OPT=&amp;quot;-DNRFX_SAADC_ENABLED=1&amp;quot;&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;Kind regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Håkon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configuring SAADC on NRF9160 using the lower level driver instead of Zephyr</title><link>https://devzone.nordicsemi.com/thread/226651?ContentTypeID=1</link><pubDate>Sat, 21 Dec 2019 00:36:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:552d1f50-891d-4ab7-ace3-934426446c36</guid><dc:creator>Marciano-PL</dc:creator><description>&lt;p&gt;Hello Hakon!&lt;/p&gt;
&lt;p&gt;I am facing the same problem, but on the nRF5340. When I attempt this solution, I get a compiler error &lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;conflicting types for saadc_handler&lt;/pre&gt;
&lt;p&gt;as it follows the signature of&amp;nbsp;&lt;strong&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;typedef void (* nrfx_saadc_event_handler_t)(nrfx_saadc_evt_t const * p_event);&lt;/pre&gt;
&lt;p&gt;instead of&lt;/p&gt;
&lt;pre&gt;__attribute__ ((interrupt (&amp;quot;IRQ&amp;quot;))) void name(void)&lt;/pre&gt;
&lt;p&gt;How should I write my handler to compensate for the differences in the implementation method you provided above and still be able to have the same functionality?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configuring SAADC on NRF9160 using the lower level driver instead of Zephyr</title><link>https://devzone.nordicsemi.com/thread/206541?ContentTypeID=1</link><pubDate>Wed, 28 Aug 2019 09:04:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9806d2a-ea57-4e41-9aac-07f6237b8502</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There are missing components in the integration of nrfx directly into NCS, which we are working on solving. One of these is the interrupt handling. Since there&amp;#39;s an RTOS running in the background, we cannot use the NVIC functions directly, so we&amp;#39;ll have to declare the interrupt vector for the SAADC in a specific way, similar to what is done here for the PDM (see the last section of that answer):&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/50656/using-pdm-mic-on-nrf9160dk/204715#204715"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/50656/using-pdm-mic-on-nrf9160dk/204715#204715&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You have to do the same with the SAADC IRQHandler when using it in non-blocking mode using nrfx directly:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ISR_DIRECT_DECLARE(adc_isr_handler)
{
    nrfx_saadc_irq_handler();
    ISR_DIRECT_PM();
    
    return 1;
}

void main(void)
{
    IRQ_DIRECT_CONNECT(SAADC_IRQn, 0,
    adc_isr_handler, 0);
    /* Rest of main */&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We are looking into how to do this in a more streamlined way.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>