How to ensure an nRF52840 GPIO pin is disconnected at powerup via the DeviceTree board overlay file?

I would like to ensure that a particular GPIO pin is disconnected when an nRF52840 is powered up via the initial configuration specified in the DeviceTree board overlay file.  I am using nRF Connect SDK v3.2.1 with an nRF52840 Dongle.  The pin will be used later as an output, but I must ensure there are no spurious signals on the pin until that time.  What is the recommended method of doing this?

Thank you,

Ken

  • Hello Ken,

    On startup after a power-on-reset, all GPIOs are configured to their reset state (“disconnected input”), so you should not need to do anything to avoid spurious signals at startup. If this is not what you are seeing, perhaps it could be that the pin may be assigned to a peripheral or a driver in the device tree and is being reconfigured during driver initialisation?

    (PIN_CNF[0])

    "Wakeup from System OFF mode reset" is the only reset source which will not reset the GPIO registers.

    Best regards,

    Vidar

  • Hi Vidar,

    I can run my application on both the nRF52840DK and nRF52840 Dongle although I am using different pins (P1.06 and P0.13 respectively) to connect with the rest of my electronics.  Using the debugger and the DK, I have checked with that my PIN_CNF register value for the GPIO pin I am using is set as you show:  Input and Disconnect.  I checked DeviceTree as well.  Monitoring the DK pin with a scope, turning the DK on via the SW8 power switch, the GPIO pin remains stable and at 0V through the power on reset and boot.  On the other hand, when plugging the Dongle into a USB cable, the GPIO pin shows a spike and oscillating voltage as shown in the attached picture.  I think this is the root of the problem I am trying to solve.  Why is the Dongle producing this GPIO pin voltage during the power on reset and boot?  I have seen no evidence of this from the DK.

    Best regards, and good to talk with you again,

    Ken

  • Hi Ken,

    Thank you, likewise. With the DK board switches in their default positions and the USB cable connected to the J2 port, the nRF52840 will be supplied with 3 V regulated from the USB bus in normal voltage mode while the dongle is powered directly from the USB in high voltage mode. Perhaps this explains the different behaviour. Could you please try supplying the nRF52840 DK from the nRF USB to see if you get the same result?

    https://docs.nordicsemi.com/bundle/ug_nrf52840_dk/page/UG/dk/power_source.html

    Best regards,

    Vidar

  • Hi Vidar,

    I did the following with the nRF52840 DK:  Set SW9 to USB and plugged the USB cable into J3.  I did not modify the application software.  Powering the board on and off via plugging/unplugging the USB cable into my PC USB port does not produce anything weird on the GPIO pin I've been monitoring.  It seems well behaved as before.  I did note that VDD is now about 1.8V vs. 3V when powered as before.

    Also, a couple more screen shots from my scope showing the weird pulse seen on GPIO P0.13 when plugging in the nRF52840 Dongle, zoomed in on the second pic.  I'm assuming the 60Hz noise is expected.

    Ken

  • Hi Ken,

    I'm wondering if you are simply seeing noise because the inputs are high-z. To be honest, I am not entirely sure what to expect here, but I know that USB ports can be quite noisy. Have you tried probing other unused pins on the dongle to see if they exhibit similar behaviour?

    Ken58 said:
    I did note that VDD is now about 1.8V vs. 3V when powered as before.

    Yes, default is 1.8. It is controlled by the REGOUT0 register. The pre-programmed FW on the dongle sets it to 3v to be able to drive the on-board RGB LED.

    Vidar

Related