<?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>nrf5340 GPIO drive strength wonky</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/126001/nrf5340-gpio-drive-strength-wonky</link><description>Dear All: 
 I have a very strange issue that has me scratching my head. I am programming a GPIO to provide hardware reset to an i2c GPIO expanver (pcal6408a). The io expander is fully supported in zephyr 4.3.0 mainline (I am using the zephyr 4.3.0 release</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 05 Jan 2026 10:35:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/126001/nrf5340-gpio-drive-strength-wonky" /><item><title>RE: nrf5340 GPIO drive strength wonky</title><link>https://devzone.nordicsemi.com/thread/557901?ContentTypeID=1</link><pubDate>Mon, 05 Jan 2026 10:35:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a133629c-0f1e-426b-a500-d5701d779bc6</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;I am glad that you have solved the issue. Thanks for letting me know.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 GPIO drive strength wonky</title><link>https://devzone.nordicsemi.com/thread/557596?ContentTypeID=1</link><pubDate>Tue, 23 Dec 2025 17:54:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d18055ff-550f-403d-bf57-7b6e61e1cd38</guid><dc:creator>ljking2</dc:creator><description>&lt;p&gt;I finally got to the bottom of this. I had an error on my schematic, which inadvertently attached P1.04 to a power domain that was not powered up correctly. The slow fall was due to the current limit on P1.04 limiting the rate of discharge on the capacitors on the power domain.&lt;/p&gt;
&lt;p&gt;Thanks for your time, and giving me a hint that sent me looking in the right direction.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 GPIO drive strength wonky</title><link>https://devzone.nordicsemi.com/thread/556507?ContentTypeID=1</link><pubDate>Mon, 08 Dec 2025 21:40:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4fca070a-3770-447d-9135-639a6c169edb</guid><dc:creator>ljking2</dc:creator><description>&lt;p&gt;I have external pull-ups on the i2c lines, so they don&amp;#39;t really need the internal pullups.&lt;/p&gt;
&lt;p&gt;I am away on vacation for 12 days, I&amp;#39;ll give adding a pull-down a try when I get back.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 GPIO drive strength wonky</title><link>https://devzone.nordicsemi.com/thread/556451?ContentTypeID=1</link><pubDate>Mon, 08 Dec 2025 12:43:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be73f746-e63d-4c20-834c-d60c057cb3da</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Can you try a pull down resistor on the input GPIO pin (P1.04)?&lt;/p&gt;
&lt;p&gt;Also I guess you are using internal pull up resistor on the I2C pin. So, in the device tree you have to add bias&amp;nbsp;&amp;nbsp;&amp;#39;&amp;#39;bias-pull-up&amp;#39;&amp;#39; line in overlay file of I2c.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 GPIO drive strength wonky</title><link>https://devzone.nordicsemi.com/thread/556374?ContentTypeID=1</link><pubDate>Fri, 05 Dec 2025 18:19:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b08fcc3-a93a-4f2d-a422-9e22390cd098</guid><dc:creator>ljking2</dc:creator><description>&lt;p&gt;Today I moved everything to the nrf5340dy (rev 2.0.2), and build a simplified app to demonstrate the problem. It is 100% repeatable on the nrf5340dk with gpio P1.04.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;First an oscilloscope plot of the loop running with no break points. time base is 20nS/division&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/SDS00016.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Then a scope shot of the falling edge when it fails (the first time as the pcal6408 is initializing, or when there is a break-point in the main loop at the sleep call. Note the change in timebase to 50uS/div.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/SDS00017.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The test program only needs an overlay to describe the pins and connections.&amp;nbsp;Here is my test setup: The white boards are my design. The small one on the breadboard is a breakout to the flex circuit, and the board near the &amp;#39;scope probe is a sensor board.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/test_5F00_setup.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;app.overlay&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/{
        aliases {
                nreset = &amp;amp;nreset;
	};
        leds {
                status = &amp;quot;okay&amp;quot;;
                compatible = &amp;quot;gpio-leds&amp;quot;;
                nreset: nreset {
                        gpios = &amp;lt;&amp;amp;gpio1 8 GPIO_ACTIVE_LOW&amp;gt;;
                        label = &amp;quot;nRESET&amp;quot;;
                };
	};
};

&amp;amp;pinctrl {
        i2c1_default: i2c1_default {
                group1 {
                        psels = &amp;lt;NRF_PSEL(TWIM_SDA, 1, 2)&amp;gt;,
                                &amp;lt;NRF_PSEL(TWIM_SCL, 1, 3)&amp;gt;;
                };
        };

        i2c1_sleep: i2c1_sleep {
                group1 {
                        psels = &amp;lt;NRF_PSEL(TWIM_SDA, 1, 2)&amp;gt;,
                                &amp;lt;NRF_PSEL(TWIM_SCL, 1, 3)&amp;gt;;
                        low-power-enable;
                };
        };
};

&amp;amp;i2c1 {
        status = &amp;quot;okay&amp;quot;;
        compatible = &amp;quot;nordic,nrf-twim&amp;quot;;
        status = &amp;quot;okay&amp;quot;;
        pinctrl-0 = &amp;lt;&amp;amp;i2c1_default&amp;gt;;
        pinctrl-1 = &amp;lt;&amp;amp;i2c1_sleep&amp;gt;;
        pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
        zephyr,concat-buf-size = &amp;lt;512&amp;gt;;

        gpio_expander1_bank1: pcal6408a@20 {
                compatible = &amp;quot;nxp,pcal6408a&amp;quot;;
                reg = &amp;lt;0x20&amp;gt;;
                gpio-controller;
                #gpio-cells = &amp;lt;2&amp;gt;;
                ngpios = &amp;lt;8&amp;gt;;
                int-gpios = &amp;lt;&amp;amp;gpio1 4 GPIO_ACTIVE_LOW&amp;gt;;
                reset-gpios = &amp;lt;&amp;amp;gpio1 8 GPIO_ACTIVE_LOW&amp;gt;;
        };
};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;main.c&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/*
 * Copyright (c) 2012-2014 Wind River Systems, Inc.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/device.h&amp;gt;
#include &amp;lt;zephyr/drivers/gpio.h&amp;gt;
#include &amp;lt;zephyr/dt-bindings/gpio/nordic-nrf-gpio.h&amp;gt;
//#include &amp;lt;zephyr/drivers/sensor.h&amp;gt;

#define NRESET_NODE     DT_ALIAS(nreset)


int main(void)
{
int ret;
const struct gpio_dt_spec nreset = GPIO_DT_SPEC_GET(NRESET_NODE,gpios);

	printf(&amp;quot;Hello World! %s\n&amp;quot;, CONFIG_BOARD_TARGET);

        /* pulse nreset to prove it works */
        ret = gpio_is_ready_dt(&amp;amp;nreset);
        if (ret != true) {
                printk(&amp;quot;Error %d: relay is not ready on %s pin %d\n&amp;quot;,
                                ret, nreset.port-&amp;gt;name, nreset.pin);
        }

        ret = gpio_pin_configure_dt(&amp;amp;nreset, GPIO_OUTPUT_ACTIVE|NRF_GPIO_DRIVE_S0S1);
        if (ret &amp;lt; 0) {
                printk(&amp;quot;Error %d: output active %s pin %d\n&amp;quot;,
                                ret, nreset.port-&amp;gt;name, nreset.pin);
        }
        k_msleep(10);
        for( int i=1; i&amp;lt;100000; i++) {
                ret = gpio_pin_set_dt(&amp;amp;nreset, !(i&amp;amp;1));
                if (ret &amp;lt; 0) {
                        printk(&amp;quot;Error %d: relay is not output inactive %s pin %d\n&amp;quot;,
                                        ret, nreset.port-&amp;gt;name, nreset.pin);
                }
                k_msleep(1);
                // measured fall time is 20nS standard drive,
                // 10nS high drive (H0S1), and 200uS with pulldown
        }
        printf(&amp;quot;nreset test done\n&amp;quot;);

	return 0;
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>