<?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>P0.18 resets device if driven high</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/33299/p0-18-resets-device-if-driven-high</link><description>I have an input connected to P0.18 on my nRF52832, which needs to be driven high by an external source. I am running into two problems, which may or may not be related: 
 1) If I configure it as follows, with either NRF_GPIO_PIN_NOPULL or NRF_GPIO_PIN_PULLDOWN</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 13 Apr 2018 14:57:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/33299/p0-18-resets-device-if-driven-high" /><item><title>RE: P0.18 resets device if driven high</title><link>https://devzone.nordicsemi.com/thread/128280?ContentTypeID=1</link><pubDate>Fri, 13 Apr 2018 14:57:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:812332c1-e6b0-456a-b9dc-0cf43b4f76b8</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Depends on the project/compiler/IDE .. an exhaustive search tool is useful, either with find or grep. eg:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;f ENABLE_SWO&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;generates stuff like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;Search Results: 
// ENABLE_SWO activates SWO pin, otherwise SWO pin is available as GPIO
    /* Enable SWO trace functionality. If ENABLE_SWO is not defined, SWO pin will be used as GPIO (see Product
    #if defined (ENABLE_SWO)
    /* Enable SWO trace functionality. If ENABLE_SWO is not defined, SWO pin will be used as GPIO (see Product
    #if defined (DEVELOP_IN_NRF52832) &amp;amp;&amp;amp; defined (ENABLE_SWO)
    /* Enable SWO trace functionality. If ENABLE_SWO is not defined, SWO pin will be used as GPIO (see Product
    #if defined (ENABLE_SWO)

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;f CONFIG_GPIO_AS_RESET&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;Search Results: 
// Notes on Reset Pin - CONFIG_GPIO_AS_PINRESET
// If CONFIG_GPIO_AS_PINRESET is defined in the project SystemInit() will set this pin to nReset
// CONFIG_GPIO_AS_PINRESET activates pin reset, otherwise pin nRESET is available as GPIO
          &amp;lt;state&amp;gt;CONFIG_GPIO_AS_PINRESET&amp;lt;/state&amp;gt;
          &amp;lt;state&amp;gt;CONFIG_GPIO_AS_PINRESET&amp;lt;/state&amp;gt;
                    &amp;lt;state&amp;gt;CONFIG_GPIO_AS_PINRESET&amp;lt;/state&amp;gt;
                    &amp;lt;state&amp;gt;CONFIG_GPIO_AS_PINRESET&amp;lt;/state&amp;gt;
#define CONFIG_GPIO_AS_PINRESET 1
              &amp;lt;Define&amp;gt; BOARD_PCA10040 CONFIG_GPIO_AS_PINRESET NRF52 NRF52832_XXAA NRF52_PAN_74 NRF_SD_BLE_API_VERSION=5 S132 SOFTDEVICE_PRESENT SWI_DISABLE0&amp;lt;/Define&amp;gt;
              &amp;lt;MiscControls&amp;gt; --cpreproc_opts=-DBOARD_PCA10040,-DCONFIG_GPIO_AS_PINRESET,-DNRF52,-DNRF52832_XXAA,-DNRF52_PAN_74,-DNRF_SD_BLE_API_VERSION=5,-DS132,-DSOFTDEVICE_PRESENT,-DSWI_DISABLE0&amp;lt;/MiscControls&amp;gt;
              &amp;lt;Define&amp;gt; BOARD_PCA10040 CONFIG_GPIO_AS_PINRESET NRF52 NRF52832_XXAA NRF52_PAN_74 NRF_SD_BLE_API_VERSION=5 S132 SOFTDEVICE_PRESENT SWI_DISABLE0&amp;lt;/Define&amp;gt;
CFLAGS += -DCONFIG_GPIO_AS_PINRESET
ASMFLAGS += -DCONFIG_GPIO_AS_PINRESET
          &amp;lt;state&amp;gt;CONFIG_GPIO_AS_PINRESET&amp;lt;/state&amp;gt;
          &amp;lt;state&amp;gt;CONFIG_GPIO_AS_PINRESET&amp;lt;/state&amp;gt;
              &amp;lt;state&amp;gt;CONFIG_GPIO_AS_PINRESET&amp;lt;/state&amp;gt;
                    &amp;lt;state&amp;gt;CONFIG_GPIO_AS_PINRESET&amp;lt;/state&amp;gt;
                    &amp;lt;state&amp;gt;CONFIG_GPIO_AS_PINRESET&amp;lt;/state&amp;gt;
                            &amp;lt;state&amp;gt;CONFIG_GPIO_AS_PINRESET&amp;lt;/state&amp;gt;
                    &amp;lt;state&amp;gt;CONFIG_GPIO_AS_PINRESET&amp;lt;/state&amp;gt;
                    &amp;lt;state&amp;gt;CONFIG_GPIO_AS_PINRESET&amp;lt;/state&amp;gt;
          &amp;lt;state&amp;gt;CONFIG_GPIO_AS_PINRESET&amp;lt;/state&amp;gt;
          &amp;lt;state&amp;gt;CONFIG_GPIO_AS_PINRESET&amp;lt;/state&amp;gt;
    /* Configure GPIO pads as pPin Reset pin if Pin Reset capabilities desired. If CONFIG_GPIO_AS_PINRESET is not
    #if defined (CONFIG_GPIO_AS_PINRESET)
etc etc&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Have to edit my search batch file &lt;em&gt;f.bat&lt;/em&gt; to add in GCC and other compilers files to search:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;echo Search Results: &amp;gt;SearchResult.txt
for /R %%f in (*.c *.h *.asm *.s *.src *.eww *.ewp *.uvmpw *.uvproj makefile) DO type %%f | find /I &amp;quot;%1&amp;quot; &amp;gt;&amp;gt; SearchResult.txt
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: P0.18 resets device if driven high</title><link>https://devzone.nordicsemi.com/thread/128067?ContentTypeID=1</link><pubDate>Thu, 12 Apr 2018 12:58:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c74e6efa-b211-49df-a919-71216f2c2ca1</guid><dc:creator>zolotiyeruki</dc:creator><description>&lt;p&gt;Do you mean the Makefile?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: P0.18 resets device if driven high</title><link>https://devzone.nordicsemi.com/thread/127922?ContentTypeID=1</link><pubDate>Wed, 11 Apr 2018 21:29:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55e9554c-65e8-4d44-ba62-898ef316acc7</guid><dc:creator>Daniel Wang</dc:creator><description>&lt;p&gt;on issue #2, try using &lt;span&gt;IN_EVENT&amp;nbsp;&lt;/span&gt;instead.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_LOTOHI(true);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: P0.18 resets device if driven high</title><link>https://devzone.nordicsemi.com/thread/127921?ContentTypeID=1</link><pubDate>Wed, 11 Apr 2018 21:14:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab1b8eea-fa61-4d7c-b914-ce219841000f</guid><dc:creator>zolotiyeruki</dc:creator><description>&lt;p&gt;I may have figured out Problem #1--I think that despite my best efforts, when trying to connect P0.18 to Vcc, I was also accidentally bridging both to GND, causing a short.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: P0.18 resets device if driven high</title><link>https://devzone.nordicsemi.com/thread/127913?ContentTypeID=1</link><pubDate>Wed, 11 Apr 2018 20:21:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9d3b503-76e7-450a-99d2-1266efb0c70a</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;I don&amp;#39;t mean to be pedantic, but the definitions are not in c or h files but in the project file - if used; I know someone was caught out by this (ie me). Your scenario matches exactly ..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: P0.18 resets device if driven high</title><link>https://devzone.nordicsemi.com/thread/127910?ContentTypeID=1</link><pubDate>Wed, 11 Apr 2018 20:08:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a74b96c-ad00-40f5-bed7-9f4b34d645dd</guid><dc:creator>zolotiyeruki</dc:creator><description>&lt;p&gt;ENABLE_TRACE is not defined, either.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: P0.18 resets device if driven high</title><link>https://devzone.nordicsemi.com/thread/127908?ContentTypeID=1</link><pubDate>Wed, 11 Apr 2018 20:05:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0b30af0-8a6a-4938-a6ee-04e8a0cfacd6</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Nor ENABLE_TRACE?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: P0.18 resets device if driven high</title><link>https://devzone.nordicsemi.com/thread/127900?ContentTypeID=1</link><pubDate>Wed, 11 Apr 2018 18:45:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00bf48d6-cc37-464f-b60e-f5b2d4863589</guid><dc:creator>zolotiyeruki</dc:creator><description>&lt;p&gt;I looked into that earlier.&amp;nbsp; ENABLE_SWO is not defined anywhere in the project as far as I can tell (Eclipse has it greyed out).&amp;nbsp; Nothing else is connected to that pin--it&amp;#39;s on an external target, so only VTG, GND, SWDIO and SWCLK are connected to anything external.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: P0.18 resets device if driven high</title><link>https://devzone.nordicsemi.com/thread/127899?ContentTypeID=1</link><pubDate>Wed, 11 Apr 2018 18:42:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2b1fbd5-4c14-4d69-aa45-1a9e14181cc2</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;What is connected to SWO? I ask since it may be connected to a debug tool or other device, since SWO happens to be P0.18 and is used as an output for debug ot trace, see below; if the pin is driving high and it is pulled low externally it can force the power rail into current limit which causes the voltage dip and subsequent device reset.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void SystemInit(void)
{
    /* Enable SWO trace functionality. If ENABLE_SWO is not defined, SWO pin will be used as GPIO (see Product
       Specification to see which one). */
    #if defined (ENABLE_SWO)
        CoreDebug-&amp;gt;DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
        NRF_CLOCK-&amp;gt;TRACECONFIG |= CLOCK_TRACECONFIG_TRACEMUX_Serial &amp;lt;&amp;lt; CLOCK_TRACECONFIG_TRACEMUX_Pos;
        NRF_P0-&amp;gt;PIN_CNF[18] = (GPIO_PIN_CNF_DRIVE_H0H1 &amp;lt;&amp;lt; GPIO_PIN_CNF_DRIVE_Pos) | (GPIO_PIN_CNF_INPUT_Connect &amp;lt;&amp;lt; GPIO_PIN_CNF_INPUT_Pos) | (GPIO_PIN_CNF_DIR_Output &amp;lt;&amp;lt; GPIO_PIN_CNF_DIR_Pos);
    #endif

    /* Enable Trace functionality. If ENABLE_TRACE is not defined, TRACE pins will be used as GPIOs (see Product
       Specification to see which ones). */
    #if defined (ENABLE_TRACE)
        CoreDebug-&amp;gt;DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
        NRF_CLOCK-&amp;gt;TRACECONFIG |= CLOCK_TRACECONFIG_TRACEMUX_Parallel &amp;lt;&amp;lt; CLOCK_TRACECONFIG_TRACEMUX_Pos;
        NRF_P0-&amp;gt;PIN_CNF[14] = (GPIO_PIN_CNF_DRIVE_H0H1 &amp;lt;&amp;lt; GPIO_PIN_CNF_DRIVE_Pos) | (GPIO_PIN_CNF_INPUT_Connect &amp;lt;&amp;lt; GPIO_PIN_CNF_INPUT_Pos) | (GPIO_PIN_CNF_DIR_Output &amp;lt;&amp;lt; GPIO_PIN_CNF_DIR_Pos);
        NRF_P0-&amp;gt;PIN_CNF[15] = (GPIO_PIN_CNF_DRIVE_H0H1 &amp;lt;&amp;lt; GPIO_PIN_CNF_DRIVE_Pos) | (GPIO_PIN_CNF_INPUT_Connect &amp;lt;&amp;lt; GPIO_PIN_CNF_INPUT_Pos) | (GPIO_PIN_CNF_DIR_Output &amp;lt;&amp;lt; GPIO_PIN_CNF_DIR_Pos);
        NRF_P0-&amp;gt;PIN_CNF[16] = (GPIO_PIN_CNF_DRIVE_H0H1 &amp;lt;&amp;lt; GPIO_PIN_CNF_DRIVE_Pos) | (GPIO_PIN_CNF_INPUT_Connect &amp;lt;&amp;lt; GPIO_PIN_CNF_INPUT_Pos) | (GPIO_PIN_CNF_DIR_Output &amp;lt;&amp;lt; GPIO_PIN_CNF_DIR_Pos);
        NRF_P0-&amp;gt;PIN_CNF[18] = (GPIO_PIN_CNF_DRIVE_H0H1 &amp;lt;&amp;lt; GPIO_PIN_CNF_DRIVE_Pos) | (GPIO_PIN_CNF_INPUT_Connect &amp;lt;&amp;lt; GPIO_PIN_CNF_INPUT_Pos) | (GPIO_PIN_CNF_DIR_Output &amp;lt;&amp;lt; GPIO_PIN_CNF_DIR_Pos);
        NRF_P0-&amp;gt;PIN_CNF[20] = (GPIO_PIN_CNF_DRIVE_H0H1 &amp;lt;&amp;lt; GPIO_PIN_CNF_DRIVE_Pos) | (GPIO_PIN_CNF_INPUT_Connect &amp;lt;&amp;lt; GPIO_PIN_CNF_INPUT_Pos) | (GPIO_PIN_CNF_DIR_Output &amp;lt;&amp;lt; GPIO_PIN_CNF_DIR_Pos);
    #endif
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>