<?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>Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71636/continuous-periodic-nrf52840-adc-sampling-with-zephyr</link><description>Hello, guys. 
 We are using Zephyr RTOS (NCS v1.4.2) with nRF52840 development kit. 
 The idea is to have continuous ADC sampling on two ADC channels. So far, I was able to properly initialize the ADC device, and get one single ADC read with the following</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 29 Feb 2024 11:53:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71636/continuous-periodic-nrf52840-adc-sampling-with-zephyr" /><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/471510?ContentTypeID=1</link><pubDate>Thu, 29 Feb 2024 11:53:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76e4b9d2-e6db-4258-af90-e9d3f9a5fc69</guid><dc:creator>xproto</dc:creator><description>&lt;p&gt;Ok good to know Einar since it is indicated not supported and confirmed over testing on the board. I&amp;#39;ll try editing this code and get back to you If I still have question (maybe new thread). Thank you again!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/471505?ContentTypeID=1</link><pubDate>Thu, 29 Feb 2024 11:41:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a19ef00-752a-4d1d-a09c-1a75504cdabb</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;No, that is correct. But even if the samples does not work out of the box on the nRF52 DK, the principles are the same and can e used also on the nRF52832.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/471487?ContentTypeID=1</link><pubDate>Thu, 29 Feb 2024 10:16:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d71e3e5a-7560-475c-b8c1-c7a8365f5a68</guid><dc:creator>xproto</dc:creator><description>&lt;p&gt;Thank you and I&amp;#39;m sorry I was not able to&amp;nbsp;point out&amp;nbsp;that I&amp;#39;m using nrf52832. Which is not supported in the link you have shared.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/470619?ContentTypeID=1</link><pubDate>Mon, 26 Feb 2024 07:40:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6be53a7b-3367-401c-ab58-608e928a35da</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There are quite a few examples for using the SAADC nrfx driver directly now, which you can find under&amp;nbsp;modules/hal/nordic/nrfx/samples/src/nrfx_saadc/. &lt;a href="https://github.com/zephyrproject-rtos/hal_nordic/tree/master/nrfx/samples/src/nrfx_saadc/advanced_non_blocking_internal_timer"&gt;advanced_non_blocking_internal_timer&lt;/a&gt;&amp;nbsp;is probably most relevant in this case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/470569?ContentTypeID=1</link><pubDate>Sun, 25 Feb 2024 12:38:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41961dd4-e86f-424b-bff0-2fe926371c88</guid><dc:creator>xproto</dc:creator><description>&lt;p&gt;Hello, Its been three years so If I may ask. Is there an updated example for zephyr&amp;nbsp;ADC continuous periodic sampling?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/465689?ContentTypeID=1</link><pubDate>Tue, 23 Jan 2024 22:19:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:965a9041-3f26-4c4a-8dc8-7665d88d2200</guid><dc:creator>Mike Austin (LPI)</dc:creator><description>&lt;p&gt;Hi Bojan,&lt;/p&gt;
&lt;p&gt;I am just starting with an application using NCS 2.2.0 that requires continuous sampling on one channel on the SAADC and then tests for whether the result is above the HIGH or below the LOW limit.&lt;/p&gt;
&lt;p&gt;Do you have any firmware related to your implementation of a solution you would be prepared to share with me?&lt;/p&gt;
&lt;p&gt;It might help me get to a solution more quickly.&lt;/p&gt;
&lt;p&gt;Thanks and regards,&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/303366?ContentTypeID=1</link><pubDate>Wed, 07 Apr 2021 07:26:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2c1ddab-2272-4a3e-a634-292fea584bef</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Hey, Einar!&lt;/p&gt;
&lt;p&gt;This thread is indeed long and difficult to follow! I preferred to put the ADC-related questions here rather than to open a new ticket because I was not certain this new thread will be given to you! :-)&lt;/p&gt;
&lt;p&gt;All is good for now! Thanks for your time and great support.&lt;/p&gt;
&lt;p&gt;Cheers &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f37b.svg" title="Beers"&gt;&amp;#x1f37b;&lt;/span&gt;,&lt;/p&gt;
&lt;p&gt;Bojan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/303364?ContentTypeID=1</link><pubDate>Wed, 07 Apr 2021 07:13:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3592437-9942-47fc-a680-13672a7b42ab</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Bojan,&lt;/p&gt;
&lt;p&gt;Ah, I see. It seems I lost my way around this thread and apparently also my memory over Easter :D Good to hear it is resolved. Thank you for reminding me &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/303270?ContentTypeID=1</link><pubDate>Tue, 06 Apr 2021 16:02:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:093a002f-b1ab-4cc7-8656-efdd14834985</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Hi, Einar.&lt;/p&gt;
&lt;p&gt;Yes, I believe the issue is resolved now as I described above.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/63074/buffer-order-swap-of-saadc-used-with-nrf-mesh"&gt;This thread&lt;/a&gt; helped a lot. An additional PPI channel is needed to trigger the START task on END event! All is good for now!&lt;/p&gt;
&lt;p&gt;Thank you very much for your readiness to jump in and help!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Bojan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/303258?ContentTypeID=1</link><pubDate>Tue, 06 Apr 2021 15:21:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab74c1ff-4c98-43f7-b136-f55b85d3b982</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Bojan,&lt;/p&gt;
&lt;p&gt;I am sorry for the late reply. I have been away&amp;nbsp;during Easter. Have you had any progress in the meantime?&lt;/p&gt;
&lt;p&gt;There have been some issues with inverted SAADC buffers, but I do not immediately see what causes it here so I need to think a bit about it and get back to you.&lt;/p&gt;
&lt;p&gt;Regarding&amp;nbsp;nrfx_saadc_v2.h in NCS the V2 API is the only available there, and is what you find in nrfx_saadc.h in NCS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/302224?ContentTypeID=1</link><pubDate>Fri, 26 Mar 2021 19:06:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e480af1e-814b-43fa-8d8e-e7ae5c14f6f6</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Hey, Einar.&lt;/p&gt;
&lt;p&gt;No worries. I dug deeper today and found a solution. &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/63074/buffer-order-swap-of-saadc-used-with-nrf-mesh"&gt;This thread&lt;/a&gt; helped a lot. An additional PPI channel is needed to trigger the START task on END event! All is good for now!&lt;/p&gt;
&lt;p&gt;Thank you very much for your readiness to jump in and help!&lt;/p&gt;
&lt;p&gt;Happy Easter! Have a great holiday!&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Bojan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/302221?ContentTypeID=1</link><pubDate>Fri, 26 Mar 2021 18:15:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1721c1cb-96f9-4f04-8e6e-f9dd92344383</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Bojan,&lt;/p&gt;
&lt;p&gt;I did not get a chance to look at this today unfortunately, and I am out of office the whole next week. I can look more at this in one and a half week, but if that is not early enough I suggest you open a new case with this specific issue.&lt;/p&gt;
&lt;p&gt;Regarding not finding nrfx_saadc_v2.h in latest NCS v1.5.0 that is because the V2 API is the only API that is available there, so that is what you have in nrfx_saadc.h.&lt;/p&gt;
&lt;p&gt;Happy Easter!&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/302066?ContentTypeID=1</link><pubDate>Fri, 26 Mar 2021 08:34:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:101ee05c-260f-4c05-abf0-84e64b001ce5</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Hello, Einar.&lt;/p&gt;
&lt;p&gt;I hope you are doing well. There is one strange thing I noticed recently while playing with ADC.&lt;/p&gt;
&lt;p&gt;It can happen that the ADC samples in buffer swap the position:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1616746214091v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;As you can see above, I am sampling only two ADC channels. My configuration is similar like I found in your &lt;a href="https://github.com/einarthorsrud/nrfx_saadc_v2_multi_channel_ppi"&gt;unofficial SAADC example&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;- There are two sampling buffers, both of size 2 (to store one ADC sample of each channel).&lt;/p&gt;
&lt;p&gt;In my particular use case, I am playing with ADC limits (both HIGH and LOW). This is working fine. For both ADC channels, I was able to set the limits and to get appropriate feedback through &lt;strong&gt;&lt;span style="background-color:#ff99cc;"&gt;NRFX_SAADC_EVT_LIMIT&lt;/span&gt; &lt;/strong&gt;in &lt;strong&gt;&lt;span style="background-color:#ccffff;"&gt;&lt;em&gt;event_handler()&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt; function.&lt;/p&gt;
&lt;p&gt;The trouble sometimes comes when I want to read and process ADC samples. As you can see from the image above, the order of ADC samples in sampling buffer swaps only once, at the very beginning, and remains wrong for the rest of the application runtime.&lt;/p&gt;
&lt;p&gt;ADC sampling frequency when sample swapping occurs is equal to 1KHz. The time my application needs to read and process ADC samples is in order of 10-20us so I would not say this is an issue. The swapping occurs even when I just want to read ADC samples without any further data processing.&lt;/p&gt;
&lt;p&gt;When I slow down ADC sampling rate to 200Hz, let&amp;#39;s say, the swapping of ADC samples does not happen.&lt;/p&gt;
&lt;p&gt;Do you have any idea what I am doing wrong?&lt;/p&gt;
&lt;p&gt;Thanks in advance for your time and efforts!&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;
&lt;p&gt;Bojan&lt;/p&gt;
&lt;p&gt;P.S. I did not find &lt;span style="background-color:#ccffcc;"&gt;&lt;em&gt;nrfx_saadc_v2.h&lt;/em&gt;&lt;/span&gt; in latest NCS v1.5.0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/299039?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 14:17:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:063a2ce5-643c-411d-9542-bcbb3e6116d8</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Bojan,&lt;/p&gt;
[quote user="bojan"]What is the difference between version 1 and version 2 of nrfx_saadc drivers?[/quote]
&lt;p&gt;The SAADC driver was completely rewritten, so there are a number of differences. Generally, the version 2 SAADC driver includes more workarounds for HW limitations.,&lt;/p&gt;
[quote user="bojan"]Is this version 2 already included in version 1.5.0 of nRF Connect SDK?[/quote]
&lt;p&gt;Yes. nRF Connect SDK includes nrfx 2.4.0.&lt;/p&gt;
[quote user="bojan"]Finally, do you recommend using version 2 for production code?[/quote]
&lt;p&gt;For NCS, you should use the one that tis part of the NCS vision you are using (which will be version 2.x.x these days). For the nRF5 SDK 17.x.x you can choose, but I recommend using the V2 API for the SAADC.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/298953?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 10:17:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d917911a-22bc-4eed-9a0a-ac79af088a86</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Thank YOU for the great support!&lt;/p&gt;
&lt;p&gt;By the way, I am using an official version of nrfx_saadc drivers that can be found under:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;ncs/v1.4.2/modules/hal/nordic/nfrx/drivers/include&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You are playing with version 2 of the nrfx_saadc drivers in your repo (&lt;a href="https://github.com/einarthorsrud/nrfx_saadc_v2_multi_channel_ppi" rel="noopener noreferrer" target="_blank"&gt;link&lt;/a&gt;). I noticed that nrfx_saadc_v2 is already included in nRF SDK 17.2 under:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;SDK_ROOT/modules/nrfx/drivers/include&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;What is the difference between version 1 and version 2 of nrfx_saadc drivers? Is this version 2 already included in version 1.5.0 of nRF Connect SDK? Finally, do you recommend using version 2 for production code?&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Bojan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/298910?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 08:12:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:470c66c5-1ace-48a6-aadb-61c7470cb8b1</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Ah, of course. I did not catch that the API was changed. Good to hear it works now. Thank you for updating us!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/298840?ContentTypeID=1</link><pubDate>Tue, 09 Mar 2021 19:11:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99970784-e964-4e5a-8e23-f172de10f007</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Hey, Einar. &lt;/p&gt;
&lt;p&gt;I figured it out. In NCS environment, &lt;span style="background-color:#ccffff;"&gt;&lt;em&gt;&lt;strong&gt;nrf_saadc_task_address_get()&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt; function requires two arguments:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**
 * @brief Function for getting the address of the specified SAADC task register.
 *
 * @param[in] p_reg Pointer to the structure of registers of the peripheral.
 * @param[in] task  SAADC task.
 *
 * @return Address of the specified SAADC task.
 */
NRF_STATIC_INLINE uint32_t nrf_saadc_task_address_get(NRF_SAADC_Type const * p_reg,
                                                      nrf_saadc_task_t       task);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Consequently, what I did in the code is:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    err_code = nrfx_ppi_channel_assign(m_timer_saadc_ppi_channel, 
                                       nrfx_timer_event_address_get(&amp;amp;m_sample_timer, NRF_TIMER_EVENT_COMPARE0),
                                       nrf_saadc_task_address_get((NRF_SAADC_Type *)0x40007000, NRF_SAADC_TASK_SAMPLE));&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and it is now working well.&lt;/p&gt;
&lt;p&gt;Thanks once again, man!&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Bojan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/298839?ContentTypeID=1</link><pubDate>Tue, 09 Mar 2021 19:04:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c949cfc-c725-425b-bbb3-522a44e057fd</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Bojan,&lt;/p&gt;
&lt;p&gt;It seems this is not valid C++ code. Perhaps&amp;nbsp;you can just replace&amp;nbsp;&lt;code&gt;nrf_saadc_task_address_get(NRF_SAADC_TASK_SAMPLE)&lt;/code&gt; with &lt;code&gt;NRF_SAADC-&amp;gt;TASKS_SAMPLE&lt;/code&gt; or just a pointer to&amp;nbsp;0x40007004?&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/298568?ContentTypeID=1</link><pubDate>Tue, 09 Mar 2021 07:40:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31f8bc46-a066-45d7-8a76-707328d2719a</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Hello, Einar.&lt;/p&gt;
&lt;p&gt;I was able to resolve the issue around timer and saadc peripherals (&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/72487/how-to-use-nrfx-saadc-driver-on-zephyr-rtos" rel="noopener noreferrer" target="_blank"&gt;link&lt;/a&gt;). They are now both properly initialized and running.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;There is one step left in order to successfully port &lt;a href="https://github.com/einarthorsrud/nrfx_saadc_v2_multi_channel_ppi/blob/main/main.c" rel="noopener noreferrer" target="_blank"&gt;your code&lt;/a&gt; into Zephyr environment - to implement PPI functionality and trigger SAADC sampling on timer1 interrupt. I have this error in &lt;span style="background-color:#ccffff;"&gt;&lt;em&gt;&lt;strong&gt;ppi_init()&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt; function:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;../src/main.cpp: In function &amp;#39;void ppi_init()&amp;#39;:
../src/main.cpp:161:67: error: cannot convert &amp;#39;nrf_saadc_task_t&amp;#39; to &amp;#39;const NRF_SAADC_Type*&amp;#39;
  161 |                                        nrf_saadc_task_address_get(NRF_SAADC_TASK_SAMPLE));
      |                                                                   ^~~~~~~~~~~~~~~~~~~~~
      |                                                                   |
      |                                                                   nrf_saadc_task_t
In file included from D:/Users/bojan/ncs/v1.4.2/modules/hal/nordic/nrfx/drivers/include/nrfx_saadc.h:36,
                 from ../src/main.cpp:58:
D:/Users/bojan/ncs/v1.4.2/modules/hal/nordic/nrfx/hal/nrf_saadc.h:639:78: note:   initializing argument 1 of &amp;#39;uint32_t nrf_saadc_task_address_get(const NRF_SAADC_Type*, nrf_saadc_task_t)&amp;#39;
  639 | NRF_STATIC_INLINE uint32_t nrf_saadc_task_address_get(NRF_SAADC_Type const * p_reg,
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Any idea what&amp;#39;s wrong on my side?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Bojan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/298315?ContentTypeID=1</link><pubDate>Mon, 08 Mar 2021 10:24:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c41dc684-84b6-45ba-b114-8f00f74f26af</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Just figured out that I needed to include:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_ADC=n
CONFIG_NRFX_SAADC=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Instead of:&lt;/p&gt;
&lt;div class="evolution-code-editor theme-clouds"&gt;
&lt;div class=" ace_editor ace-clouds" style="height:28px;width:100%;"&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_ADC=n
CONFIG_ADC_NRFX_SAADC=y&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="evolution-code-editor theme-clouds"&gt;
&lt;div class=" ace_editor ace-clouds" style="height:28px;width:100%;"&gt;
&lt;div style="font:inherit;height:auto;left:0px;overflow:hidden;position:absolute;top:0px;white-space:pre;width:auto;"&gt;
&lt;div style="font:inherit;height:auto;left:0px;overflow:visible;position:absolute;top:0px;white-space:pre;width:auto;"&gt;&lt;/div&gt;
&lt;div style="font-family:inherit;font-size:inherit;font-style:inherit;height:auto;left:0px;line-height:inherit;overflow:visible;position:absolute;top:0px;white-space:pre;width:auto;"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="content-scrollable-wrapper" style="overflow:auto;"&gt;&lt;/div&gt;
&lt;p&gt;The code now compiles but when I try to debug it I get stuck:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.4.0-ncs2  ***
[00:00:00.345,001] &#x1B;[1;31m&amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 1: Unhandled interrupt on CPU 0&#x1B;[0m
[00:00:00.353,698] &#x1B;[1;31m&amp;lt;err&amp;gt; os: Current thread: 0x20002708 (unknown)&#x1B;[0m
[00:00:00.365,783] &#x1B;[1;31m&amp;lt;err&amp;gt; fatal_error: Resetting system&#x1B;[0m&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1615200168468v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;The only thing I have in my main() function is adc_configure() with the following content:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void adc_configure(void)
{
    int err_code;

    nrfx_saadc_adv_config_t saadc_adv_config = NRFX_SAADC_DEFAULT_ADV_CONFIG;
    saadc_adv_config.internal_timer_cc = 0;
    saadc_adv_config.start_on_end = true;

    err_code = nrfx_saadc_init(NRFX_SAADC_DEFAULT_CONFIG_IRQ_PRIORITY);
    //APP_ERROR_CHECK(err_code);

    static nrfx_saadc_channel_t channel_configs[ADC_CHANNELS_IN_USE];

    uint8_t channel_mask = 0;
    for(int i = 0; i &amp;lt; ADC_CHANNELS_IN_USE; i++) {
        nrf_saadc_input_t pin = ANALOG_INPUT_MAP[i];
        // Apply default config to each channel
        nrfx_saadc_channel_t config = NRFX_SAADC_DEFAULT_CHANNEL_SE(pin, i);

        // Replace some parameters in default config
        config.channel_config.reference = NRF_SAADC_REFERENCE_VDD4;          
        config.channel_config.gain = NRF_SAADC_GAIN1_4;

        // Copy to list of channel configs
        memcpy(&amp;amp;channel_configs[i], &amp;amp;config, sizeof(config));

        // Update channel mask
        channel_mask |= 1 &amp;lt;&amp;lt; i;
    }

    err_code = nrfx_saadc_channels_config(channel_configs, ADC_CHANNELS_IN_USE);
    //APP_ERROR_CHECK(err_code);

    err_code = nrfx_saadc_advanced_mode_set(channel_mask,
                                            NRF_SAADC_RESOLUTION_14BIT,
                                            &amp;amp;saadc_adv_config,
                                            event_handler);
    //APP_ERROR_CHECK(err_code);
                                            
    // Configure two buffers to ensure double buffering of samples, to avoid data loss when the sampling frequency is high
    err_code = nrfx_saadc_buffer_set(&amp;amp;samples[next_free_buf_index()][0], SAADC_BUF_SIZE);
    //APP_ERROR_CHECK(err_code);

    err_code = nrfx_saadc_buffer_set(&amp;amp;samples[next_free_buf_index()][0], SAADC_BUF_SIZE);
    //APP_ERROR_CHECK(err_code);

    err_code = nrfx_saadc_mode_trigger();
    //APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Please help.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Bojan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/298207?ContentTypeID=1</link><pubDate>Sat, 06 Mar 2021 11:38:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9dfa7f0a-622a-4a00-befa-336fd4e471a9</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Hello, Einar. &lt;/p&gt;
&lt;p&gt;I am trying to port your &lt;a href="https://github.com/einarthorsrud/nrfx_saadc_v2_multi_channel_ppi" rel="noopener noreferrer" target="_blank"&gt;unofficial SAADC example&lt;/a&gt; into Zephyr environment.&lt;/p&gt;
&lt;p&gt;As a first goal, I wanted to test only &lt;em&gt;&lt;span style="background-color:rgba(204, 255, 255, 1);"&gt;adc_configure()&lt;/span&gt;&lt;/em&gt; function. According to &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/boards/nrf/nrfx/README.html?highlight=nrfx#building-and-running"&gt;nrfx use example&lt;/a&gt; that shows how to use nrfx drivers in Zephyr, I did the following in my &lt;span style="background-color:rgba(255, 153, 204, 1);"&gt;&lt;em&gt;prj.config&lt;/em&gt;&lt;/span&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_ADC=n
CONFIG_ADC_NRFX_SAADC=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I also included nrfx_saadc header file&amp;nbsp; line in my main.cpp file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;nrfx_saadc.h&amp;gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;When I compile the code, the compiler complains about undefined reference to &lt;span style="background-color:rgba(255, 153, 204, 1);"&gt;&lt;em&gt;nrfx_saadc_xxx()&lt;/em&gt;&lt;/span&gt; functions that are all declared in included &lt;em&gt;&lt;span style="background-color:rgba(204, 255, 255, 1);"&gt;nrfx_saadc.h &lt;/span&gt;&lt;/em&gt;file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;build/../src/main.cpp:187: undefined reference to `nrfx_saadc_channels_config&amp;#39;
build/../src/main.cpp:190: undefined reference to `nrfx_saadc_advanced_mode_set&amp;#39;
build/../src/main.cpp:197: undefined reference to `nrfx_saadc_buffer_set&amp;#39;
build/../src/main.cpp:200: undefined reference to `nrfx_saadc_buffer_set&amp;#39;
build/../src/main.cpp:203: undefined reference to `nrfx_saadc_mode_trigger&amp;#39;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Do you have any idea what I am missing here? Do I need to include something more in my &lt;span style="background-color:rgba(255, 153, 204, 1);"&gt;&lt;em&gt;prj.config&lt;/em&gt;&lt;/span&gt; file that will disable the usage of Zephyr ADC APIs and encourage the usage of NRFX SAADC driver?&lt;/p&gt;
&lt;p&gt;Thanks in advance for your time and efforts.&lt;/p&gt;
&lt;p&gt;Sincerely,&lt;/p&gt;
&lt;p&gt;Bojan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/294376?ContentTypeID=1</link><pubDate>Mon, 15 Feb 2021 12:36:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f72ce7b-d8b9-4f33-9310-ca4af01043fb</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;&lt;span&gt;Thank you for the feedback, Bojan. We are happy to help &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;I have requested the case to become public but you need to approve it.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Einar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/294375?ContentTypeID=1</link><pubDate>Mon, 15 Feb 2021 12:18:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dfcda7a3-525d-4925-a6f0-3c1bec8e5c6b</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;This is what I call great support!&lt;/p&gt;
&lt;p&gt;Thank you very much, Einer!&lt;/p&gt;
&lt;p&gt;No more questions concerning ADC converter! :-)&lt;/p&gt;
&lt;p&gt;By the way, I just noticed that this ticket is private. Can we move it to Public area so that the rest of the people can hopefully benefit from it?&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Bojan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/294374?ContentTypeID=1</link><pubDate>Mon, 15 Feb 2021 12:09:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb265adb-d1f9-4c0d-abe8-2ee2ae279723</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Bojan,&lt;/p&gt;
&lt;p&gt;The ADC calibration time depends on the previously configured acquisition time. If not yet configured, the default acquisition time of 10 us is used. The total calibration time is a few microseconds more as it includes conversion.&lt;/p&gt;
&lt;p&gt;Calibration is done to sets the correct offset, so that measuring GND will give a sample value of 0. This will normally not change over time unless the temperature changes. So you should calibrate after reset, and either regularly or when there are temperature changes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Continuous periodic nRF52840 ADC sampling with Zephyr</title><link>https://devzone.nordicsemi.com/thread/294373?ContentTypeID=1</link><pubDate>Mon, 15 Feb 2021 12:01:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e2b03f7-9b00-46d9-bc27-1b2788f13c98</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Thanks, Einar.&lt;/p&gt;
&lt;p&gt;Do you have any idea what is the duration of ADC calibration?&lt;/p&gt;
&lt;p&gt;I thought to perform ADC calibration only once, during the initialization phase rather then to do it every time before taking the sample. Does that make sense?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>