<?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>nRF52840 SDK16 - How to use the nrfx PPI driver</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82408/nrf52840-sdk16---how-to-use-the-nrfx-ppi-driver</link><description>Hi everyone, 
 I use the nrf52840 and the SDK 16. I copied the saadc example and I want to modify it and use the RTC instead of the timer as an event for PPI. I&amp;#39;ve noticed that the example uses the legacy driver instead of the new nrfx implementation</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 06 Dec 2021 15:19:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82408/nrf52840-sdk16---how-to-use-the-nrfx-ppi-driver" /><item><title>RE: nRF52840 SDK16 - How to use the nrfx PPI driver</title><link>https://devzone.nordicsemi.com/thread/342137?ContentTypeID=1</link><pubDate>Mon, 06 Dec 2021 15:19:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40317fd2-8506-4894-97c4-9bb220620e12</guid><dc:creator>haakonsh</dc:creator><description>[quote user="Nikosant03"]If I set both to 1 it compiles fine. If I set PPI_ENABLED to 0 it cannot find the nrfx based functions. So, I guess every time I use the new implementation (nrfx drivers) I have to enable the legacy as well?[/quote]
&lt;p&gt;Yes, that&amp;#39;s what I&amp;#39;ve experienced at least.&amp;nbsp;&lt;/p&gt;
[quote user="Nikosant03"]However, before commenting out it was working fine...[/quote]
&lt;p&gt;All you did was to initialize the old driver without actually using it. So some RAM and flash is wasted, but it should not break anything i think.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 SDK16 - How to use the nrfx PPI driver</title><link>https://devzone.nordicsemi.com/thread/342094?ContentTypeID=1</link><pubDate>Mon, 06 Dec 2021 13:49:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62f92ba3-2efa-4d4d-b2a9-aca040a2baa7</guid><dc:creator>Nikosant03</dc:creator><description>&lt;p&gt;Hi haakonsh,&lt;/p&gt;
&lt;p&gt;Thank you for your answer!!&lt;/p&gt;
[quote userid="13562" url="~/f/nordic-q-a/82408/nrf52840-sdk16---how-to-use-the-nrfx-ppi-driver/342078#342078"]No, there is no initialization/uninitialization functions in this API. You only need to allocate, assign, and enable a channel for it to work.[/quote]
&lt;p&gt;So this is enough? I comment out the &lt;strong&gt;nrf_drv_ppi_init()&lt;/strong&gt; function. However, before commenting out it was working fine...&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void ppi_init(void) {

  uint32_t err_code;
  uint32_t rtc_tick_event_addr;    // variable to hold the address of rtc event
  uint32_t saadc_sample_task_addr; // variable to hold the address of saadc task

  //err_code = nrf_drv_ppi_init(); // initialize the ppi module
  //APP_ERROR_CHECK(err_code);

  err_code = nrfx_ppi_channel_alloc(&amp;amp;m_ppi_channel); // allocate the channel. This function checks for the available channels and automatically allocates the channel
  APP_ERROR_CHECK(err_code);

  rtc_tick_event_addr = nrfx_rtc_event_address_get(&amp;amp;rtc, NRF_RTC_EVENT_TICK); // get the RTC event address
  saadc_sample_task_addr = nrf_drv_saadc_sample_task_get();                   // get the saadc task address

  err_code = nrfx_ppi_channel_assign(m_ppi_channel, rtc_tick_event_addr, saadc_sample_task_addr); // Assing event and task endpoints to the PPI channel
  APP_ERROR_CHECK(err_code);

  err_code = nrfx_ppi_channel_enable(m_ppi_channel); // Enable the PPI channel
  APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;
[quote userid="13562" url="~/f/nordic-q-a/82408/nrf52840-sdk16---how-to-use-the-nrfx-ppi-driver/342078#342078"]Hmm, do you you currently have an issue with building the new PPI driver? I&amp;#39;d start by setting both to 1, and if that does not work, set PPI_ENABLED to 0.&amp;nbsp;[/quote]
&lt;p&gt;If I set both to 1 it compiles fine. If I set PPI_ENABLED to 0 it cannot find the nrfx based functions. So, I guess every time I use the new implementation (nrfx drivers) I have to enable the legacy as well?&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1638798284213v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 SDK16 - How to use the nrfx PPI driver</title><link>https://devzone.nordicsemi.com/thread/342078?ContentTypeID=1</link><pubDate>Mon, 06 Dec 2021 13:22:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94a4d530-7d85-44cb-b44b-a1e6b7c173c2</guid><dc:creator>haakonsh</dc:creator><description>[quote user=""]In the API reference of&lt;span&gt;&amp;nbsp;the&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/group__nrfx__ppi.html?cp=8_5_1_6_9_0_23_1"&gt;PPI allocator&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;there is no function for initialization. Should I use the legacy API&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/group__nrf__drv__ppi.html?cp=8_5_1_6_9_0_23_0_23#ga221bc7bdc84d23a3e1b737b74b26c1cf"&gt;nrf_drv_ppi_init()&lt;/a&gt;?[/quote]
&lt;p&gt;No, there is no initialization/uninitialization functions in this API. You only need to allocate, assign, and enable a channel for it to work.&lt;/p&gt;
[quote user=""]Also, according to the following note should I keep both&amp;nbsp;PPI_ENABLED and&lt;span&gt;&amp;nbsp;&lt;/span&gt;NRFX_PPI_ENABLED set to 1?[/quote]
&lt;p&gt;Hmm, do you you currently have an issue with building the new PPI driver? I&amp;#39;d start by setting both to 1, and if that does not work, set PPI_ENABLED to 0.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>