<?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>GPIO PIN issue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39755/gpio-pin-issue</link><description>Hello, 
 I am using NRF52840 development board with SDK 15.2. I am using the template peripheral project since i want to get comfortable with the peripherals on the board. I have been trying to set some of the pins as outputs and then set them low or</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 24 Oct 2018 09:38:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39755/gpio-pin-issue" /><item><title>RE: GPIO PIN issue</title><link>https://devzone.nordicsemi.com/thread/154234?ContentTypeID=1</link><pubDate>Wed, 24 Oct 2018 09:38:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1cbb99c2-cef0-462d-9f96-9545739924f1</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Why are you writing the whole OUT register? If you are doing this, I would recommend that you use &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/gpio.html?cp=2_1_0_19_2_1#register.OUTSET"&gt;OUTSET&lt;/a&gt; and &lt;a title="  OUTCLR  " href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/gpio.html?cp=2_1_0_19_2_2#register.OUTCLR"&gt;OUTCLR&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;With that said, what I would recommend the most is to use the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/group__nrf__gpio__hal.html?cp=4_0_0_6_9_0_5_0"&gt;GPIO&amp;nbsp;HAL&lt;/a&gt; functions to configure, set and clear pins:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;&lt;span&gt;&lt;a title="nrf_gpio_cfg_input" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/group__nrf__gpio__hal.html?cp=4_0_0_6_9_0_5_0_8#gaefea00d9967a6026bb462d7e183af1f5"&gt;nrf_gpio_cfg_input&lt;/a&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;span&gt;&lt;a title="nrf_gpio_cfg_output" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/group__nrf__gpio__hal.html?cp=4_0_0_6_9_0_5_0_9#ga5c6f584e6e01dd0c65bd1b9eee958cbb"&gt;nrf_gpio_cfg_output&lt;/a&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;span&gt;&lt;a title="nrf_gpio_pin_clear" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/group__nrf__gpio__hal.html?cp=4_0_0_6_9_0_5_0_14#ga5c671adfb6b44f32c9d99d3156aff2b1"&gt;nrf_gpio_pin_clear&lt;/a&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;span&gt;&lt;a title="nrf_gpio_pin_clear" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/group__nrf__gpio__hal.html?cp=4_0_0_6_9_0_5_0_14#ga5c671adfb6b44f32c9d99d3156aff2b1"&gt;&lt;/a&gt;&lt;/span&gt;&lt;a title="nrf_gpio_pin_read" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/group__nrf__gpio__hal.html?cp=4_0_0_6_9_0_5_0_18#ga76870ecdd68f3e26eeea7ea3c5ad6b55"&gt;nrf_gpio_pin_read&lt;/a&gt;()&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;a title="nrf_gpio_pin_read" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/group__nrf__gpio__hal.html?cp=4_0_0_6_9_0_5_0_18#ga76870ecdd68f3e26eeea7ea3c5ad6b55"&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;a title="nrf_gpio_pin_set" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/group__nrf__gpio__hal.html?cp=4_0_0_6_9_0_5_0_20#gadfd30c1e5321180f1e333cf5642058e8"&gt;nrf_gpio_pin_set&lt;/a&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;span&gt;&lt;a title="nrf_gpio_pin_set" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/group__nrf__gpio__hal.html?cp=4_0_0_6_9_0_5_0_20#gadfd30c1e5321180f1e333cf5642058e8"&gt;&lt;/a&gt;&lt;/span&gt;&lt;span&gt;&lt;a title="nrf_gpio_pin_toggle" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/group__nrf__gpio__hal.html?cp=4_0_0_6_9_0_5_0_21#gac7f7bf539f5bb053b4a313ec51d8157e"&gt;nrf_gpio_pin_toggle&lt;/a&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Jørgen&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO PIN issue</title><link>https://devzone.nordicsemi.com/thread/154186?ContentTypeID=1</link><pubDate>Tue, 23 Oct 2018 21:30:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8f08e3d-54fd-4048-9ea0-a068591a743e</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;The code you listed above in the first question shows &amp;quot;&amp;amp;=&amp;quot; (a read-modify-write operation) and not &amp;quot;=&amp;quot; (a write operation). Yes just &amp;quot;=&amp;quot; 0xFFFFFFFF should indeed set them all high, which is what I was trying to say.. sorry if I was just confusing. It may be that&amp;nbsp;&lt;span&gt;&lt;em&gt;nrf_gpio_cfg_output()&lt;/em&gt; just expects a pin number, eg 6, and not the value you are passing.&amp;nbsp; See this example:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;//      Software Label  Id // Pin Name  Dir Function  Description
//      =============== == // === ===== === ========= ===========
#define LED_GREEN_PIN   30 //  29 P0.30 Out GPIO/AIN6 LED_GREEN

    //                 Pin Id                Pin Port Schematic
    //                 ===============       === ==== =========
    nrf_gpio_pin_set  (LED_GREEN_PIN   ); // 29 P0.30 LED_GREEN
    nrf_gpio_cfg(LED_GREEN_PIN,           // 29 P0.30 LED_GREEN
                 NRF_GPIO_PIN_DIR_OUTPUT,
                 NRF_GPIO_PIN_INPUT_DISCONNECT,
                 NRF_GPIO_PIN_NOPULL,
                 NRF_GPIO_PIN_H0S1,       // Require High Drive low level
                 NRF_GPIO_PIN_NOSENSE);
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO PIN issue</title><link>https://devzone.nordicsemi.com/thread/154183?ContentTypeID=1</link><pubDate>Tue, 23 Oct 2018 19:27:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74a321f1-d8a1-46ce-9b5d-3f88445345bc</guid><dc:creator>gdutk001</dc:creator><description>&lt;p&gt;Im not trying to read the value on the pin, i&amp;#39;m trying to drive the pin high and measure it using an oscilloscope. Are you saying that NRF-&amp;gt;P0-&amp;gt;OUT = 0xFFFFFFFF will not drive the pins high? I am using&amp;nbsp;&lt;span&gt;&amp;nbsp;NRF-&amp;gt;P0-&amp;gt;OUT = 0xFFFFFFFF to try and drive all the pins high and see if i can measure a difference on the pins on the development board however that is not working. is this not what&amp;nbsp;&amp;nbsp;NRF-&amp;gt;P0-&amp;gt;OUT is meant for? my guess is that im somehow not initializing the pins on the port correctly however i havent been able to verify that.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO PIN issue</title><link>https://devzone.nordicsemi.com/thread/154174?ContentTypeID=1</link><pubDate>Tue, 23 Oct 2018 16:41:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ed4de23-8406-4493-b356-2588bd257e09</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Unlike many simpler 8-bit devices most (all) ARM cores implement the io pin with separate out and in registers; reading the OUT register returns the last value written to the OUT register, not the value currently on the io pin. To read the pin, instead use the IN register. To further illustrate, look at the definition of&amp;nbsp;&lt;em&gt;nrf_gpio_pin_toggle()&lt;/em&gt; function.&lt;/p&gt;
&lt;p&gt;You can do a quick check by replacing &amp;quot;&amp;amp;=&amp;quot; with &amp;quot;=&amp;quot; and &amp;quot;|=&amp;quot; with &amp;quot;=&amp;quot; in your example, although of course you are driving all 32 pins on P0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>