<?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>Use of nrfx_dppi with nrf5340 to control one GPIO</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118681/use-of-nrfx_dppi-with-nrf5340-to-control-one-gpio</link><description>Dear, 
 I need to generate a pulse signal on one IO following this pattern: HIGH for 12us ; LOW for 106us ; and so on... 
 I tried to use TIMER0 with NRF_TIMER_EVENT_COMPARE0 and NRF_TIMER_EVENT_COMPARE1 but the signal is often not respected (keeping</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Feb 2025 20:43:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118681/use-of-nrfx_dppi-with-nrf5340-to-control-one-gpio" /><item><title>RE: Use of nrfx_dppi with nrf5340 to control one GPIO</title><link>https://devzone.nordicsemi.com/thread/524444?ContentTypeID=1</link><pubDate>Mon, 24 Feb 2025 20:43:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60acbcd9-328c-42d7-883f-04852c573440</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Ah, clever! Didn&amp;#39;t think of using the PWM peripheral like that (although it is what it is intended for, really). I was caught up in the DPPI solution.&lt;/p&gt;
&lt;p&gt;I am glad to hear that you found a solution that is working for you!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use of nrfx_dppi with nrf5340 to control one GPIO</title><link>https://devzone.nordicsemi.com/thread/524412?ContentTypeID=1</link><pubDate>Mon, 24 Feb 2025 15:48:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a50b814b-6a00-4853-9143-2a16e9708559</guid><dc:creator>Lumisoft</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;br /&gt;&lt;br /&gt;I did not used DPPI but direct PWM like this:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;pwm_set_dt(&amp;amp;pwm, PWM_USEC(PWM_PERIOD_US), PWM_USEC(PWM_DUTY_CYCLE_US));&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This approach was working and easier to managed.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;&lt;br /&gt;Michael&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use of nrfx_dppi with nrf5340 to control one GPIO</title><link>https://devzone.nordicsemi.com/thread/524284?ContentTypeID=1</link><pubDate>Mon, 24 Feb 2025 09:49:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9234db58-128c-48b1-afc1-9b1792006d3a</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Michael,&lt;/p&gt;
&lt;p&gt;Sorry for not getting back to you! I am glad to hear! Did you manage to get it working using the DPPI API? Or did you write to the registers directly?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use of nrfx_dppi with nrf5340 to control one GPIO</title><link>https://devzone.nordicsemi.com/thread/524236?ContentTypeID=1</link><pubDate>Mon, 24 Feb 2025 07:13:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0586925-815e-4049-ac43-e81607cbeb26</guid><dc:creator>Lumisoft</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;Thanks for the suggestion, in between so to unblock myself and respect my timeline, I used a solution based on a PWM which did finally the trick perfectly.&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;br /&gt;&lt;br /&gt;Michael&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use of nrfx_dppi with nrf5340 to control one GPIO</title><link>https://devzone.nordicsemi.com/thread/523224?ContentTypeID=1</link><pubDate>Mon, 17 Feb 2025 10:37:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4cff1a6-9030-46a9-a440-cdb832e68dfa</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Sorry for the late reply. I started working on something, but didn&amp;#39;t get the time to finish it yet. I saw that your approach doesn&amp;#39;t work, but also, it doesn&amp;#39;t specify what task to do on the first compare register and what task to do on the other one. I will try to get some more time to look into this today.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In case you want to have a look, I have this one for reference. Although this does the opposite. It measures the length of a pulse, so it uses the GPIOTE to capture two events.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0654.timed_5F00_signals_5F00_ncs240.zip"&gt;devzone.nordicsemi.com/.../0654.timed_5F00_signals_5F00_ncs240.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But I&amp;#39;ll look into it.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use of nrfx_dppi with nrf5340 to control one GPIO</title><link>https://devzone.nordicsemi.com/thread/522904?ContentTypeID=1</link><pubDate>Thu, 13 Feb 2025 14:48:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37701b2c-2e3f-45f2-a9c1-04968a5644f8</guid><dc:creator>Lumisoft</dc:creator><description>&lt;p&gt;Dear,&lt;/p&gt;
&lt;p&gt;I also tried to use &lt;a id="" href="https://github.com/zephyrproject-rtos/hal_nordic/blob/nrfx-3.9.0/nrfx/samples/src/nrfx_gppi/fork/main.c"&gt;https://github.com/zephyrproject-rtos/hal_nordic/blob/nrfx-3.9.0/nrfx/samples/src/nrfx_gppi/fork/main.c&lt;/a&gt; sample but it is not working with nrf SDK 2.7.0 and nrf534 dk:&lt;br /&gt;I am facing issues on IRQ_DIRECT_CONNECT for NRF_GPIOTE:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(GPIOTE_INST_IDX)), IRQ_PRIO_LOWEST,
                NRFX_GPIOTE_INST_HANDLER_GET(GPIOTE_INST_IDX), 0, 0);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Will give:&lt;br /&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;gen_isr_tables.py: error: multiple registrations at table_index 13 for irq 13 (0xd)&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Existing handler 0x7909, new handler 0xd5a5&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Has IRQ_CONNECT or IRQ_DIRECT_CONNECT accidentally been invoked on the same irq multiple times?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If I comment that line, I have already assert error on nrfx_gpiote_init...&lt;br /&gt;&lt;br /&gt;I do not understand why with a clean project for nrf5340DK this is happening. Thanks in advance for your help!&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Michael&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use of nrfx_dppi with nrf5340 to control one GPIO</title><link>https://devzone.nordicsemi.com/thread/522583?ContentTypeID=1</link><pubDate>Wed, 12 Feb 2025 08:52:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df1f4ade-e738-49a6-97d2-59816e7a7ada</guid><dc:creator>Lumisoft</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;Here is a minimalist app showing the issue. &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/minimalist.zip"&gt;devzone.nordicsemi.com/.../minimalist.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here is the line where I tested my timer:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;        // USING timer_event_handler so to verify timer and ocompare is working. This solution is not suitable as not constant when CPU is used heavily
        // err = nrfx_timer_init(&amp;amp;timer_instance, &amp;amp;timer_config, timer_event_handler);
        // USING DPPI, but nothing happening on IO...
        err = nrfx_timer_init(&amp;amp;timer_instance, &amp;amp;timer_config, NULL);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Using timer_event_handler, I can see IO is changing as expected, however it is not stable when CPU is used. Using DPPI, IO is always low... Thanks for your help!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Michael&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use of nrfx_dppi with nrf5340 to control one GPIO</title><link>https://devzone.nordicsemi.com/thread/522510?ContentTypeID=1</link><pubDate>Tue, 11 Feb 2025 16:48:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4195e421-1f21-40bb-b708-c28f977149fc</guid><dc:creator>Lumisoft</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;Thanks for your reply and suggestion. I tried to add one DPPI channel like this : &lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void gpiote_dppi_init(void)
{

    nrfx_err_t err;

    err = nrfx_gpiote_init(&amp;amp;gpiote_inst, NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY);
    if (err != NRFX_SUCCESS &amp;amp;&amp;amp; err != NRFX_ERROR_ALREADY_INITIALIZED) {
        LOG_ERR(&amp;quot;nrfx_gpiote_init error: %08x&amp;quot;, err);
        return;
    }

    nrfx_gpiote_output_config_t gpiote_config = NRFX_GPIOTE_DEFAULT_OUTPUT_CONFIG;
    err = nrfx_gpiote_output_configure(&amp;amp;gpiote_inst, mofset_ctrl_io.pin, &amp;amp;gpiote_config, NULL);
    if (err != NRFX_SUCCESS) {
        LOG_ERR(&amp;quot;nrfx_gpiote_output_configure error: %08x&amp;quot;, err);
        return;
    }

    nrfx_gpiote_trigger_enable(&amp;amp;gpiote_inst, mofset_ctrl_io.pin, true);

    err = nrfx_dppi_channel_alloc(&amp;amp;dppi_channel_a);
    if (err != NRFX_SUCCESS) {
        LOG_ERR(&amp;quot;nrfx_dppi_channel_alloc error: %08x&amp;quot;, err);
        return;
    }

	err = nrfx_dppi_channel_alloc(&amp;amp;dppi_channel_b);
    if (err != NRFX_SUCCESS) {
        LOG_ERR(&amp;quot;nrfx_dppi_channel_alloc error: %08x&amp;quot;, err);
        return;
    }

	nrfx_gppi_channel_endpoints_setup(dppi_channel_a,
	    nrfx_timer_compare_event_address_get(&amp;amp;timer_instance, NRF_TIMER_CC_CHANNEL0),
		nrfx_gpiote_out_task_address_get(&amp;amp;gpiote_inst, mofset_ctrl_io.pin));
    
    nrfx_gppi_channel_endpoints_setup(dppi_channel_b,
        nrfx_timer_compare_event_address_get(&amp;amp;timer_instance, NRF_TIMER_CC_CHANNEL1),
        nrfx_gpiote_out_task_address_get(&amp;amp;gpiote_inst, mofset_ctrl_io.pin));

    err = nrfx_dppi_channel_enable(dppi_channel_a);
    if (err != NRFX_SUCCESS) {
        LOG_ERR(&amp;quot;Failed to enable DPPI channel, error: %08x&amp;quot;, err);
        return;
    }

	err = nrfx_dppi_channel_enable(dppi_channel_b);
    if (err != NRFX_SUCCESS) {
        LOG_ERR(&amp;quot;Failed to enable DPPI channel, error: %08x&amp;quot;, err);
        return;
    }

    LOG_INF(&amp;quot;GPIOTE + DPPI initialized&amp;quot;);

}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;However, the result is still the same, IO is always at 0V. I will try to extract one minimal piece of my code so you can try and help me.&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Michael&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use of nrfx_dppi with nrf5340 to control one GPIO</title><link>https://devzone.nordicsemi.com/thread/521981?ContentTypeID=1</link><pubDate>Fri, 07 Feb 2025 14:34:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77e11f87-8853-4334-b62e-946ed386865f</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Sorry for the late reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I believe you need to use two DPPI channels, one for setting the pin high, and one for setting it low. Try that, and if it doesn&amp;#39;t work, can you please .zip and upload the application folder here, so that I can have a look?&lt;/p&gt;
&lt;p&gt;(you can drag and drop the file into where you are typing)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>