<?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>nrf52832 custom board: nrf_gpio_pin_write() does not work  (nor nrf_gpio_pin_clear())</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/34004/nrf52832-custom-board-nrf_gpio_pin_write-does-not-work-nor-nrf_gpio_pin_clear</link><description>Hello, 
 
 We have a custom board based on nRF52832. 
 there is 1 LED on P0.29: 
 #define LED_1 29 
 First I initialize the GPIO: 
 nrf_gpio_cfg_output(LED_1); // this lights on the LED which is normal because &amp;quot;set&amp;quot; is the default in this macro 
 nrf_delay_ms</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 06 May 2018 22:25:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/34004/nrf52832-custom-board-nrf_gpio_pin_write-does-not-work-nor-nrf_gpio_pin_clear" /><item><title>RE: nrf52832 custom board: nrf_gpio_pin_write() does not work  (nor nrf_gpio_pin_clear())</title><link>https://devzone.nordicsemi.com/thread/131105?ContentTypeID=1</link><pubDate>Sun, 06 May 2018 22:25:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28ae0281-9e5a-40b4-84f2-91062cf8cd2f</guid><dc:creator>JohnM</dc:creator><description>&lt;p&gt;Yes you&amp;#39;re absolutely right!&amp;nbsp; The LED anode is connected to Vdd.&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t even think about that.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 custom board: nrf_gpio_pin_write() does not work  (nor nrf_gpio_pin_clear())</title><link>https://devzone.nordicsemi.com/thread/130955?ContentTypeID=1</link><pubDate>Fri, 04 May 2018 08:33:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84e628dc-dbfe-459c-adeb-f74245000fd0</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Is the GPIO connected to the anode or cathode of the LED on your board? The reason I ask is that you write that the LED is on after the call to&amp;nbsp;nrf_gpio_cfg_output(). However, this does not set the GPIO to &amp;#39;1&amp;#39;, and the reset value of the OUT register is all zero. So essentially, it seems that your LED is connected with the anode to VDD and the cathode to VSS via the GPIO which causes it to be on when the GPIO is &amp;#39;0&amp;#39; and off when the GPIO is &amp;#39;1&amp;#39;. If this is the case, then calling nrf_gpio_pin_write(LED_1,1); or&amp;nbsp;nrf_gpio_pin_set(LED_1); will turn off the LED.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 custom board: nrf_gpio_pin_write() does not work  (nor nrf_gpio_pin_clear())</title><link>https://devzone.nordicsemi.com/thread/130802?ContentTypeID=1</link><pubDate>Thu, 03 May 2018 12:24:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad9d4cea-66b7-4747-9b86-781b55e2d395</guid><dc:creator>JohnM</dc:creator><description>&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;strong&gt;nrf_gpio_cfg_output(LED_1);&lt;br /&gt;NRF_GPIO_Type * reg&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = nrf_gpio_pin_port_decode((uint32_t *)LED_1);&lt;br /&gt;nrf_delay_ms(1000);&lt;br /&gt;&amp;nbsp;&lt;span style="color:#0000ff;"&gt;nrf_gpio_pin_write(LED_1,0):&lt;/span&gt;&lt;br /&gt;reg&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = nrf_gpio_pin_port_decode((uint32_t *)LED_1);&lt;br /&gt;uint32_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pins_state = reg-&amp;gt;OUT;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here is just BEFORE the &lt;span style="color:#0000ff;"&gt;nrf_gpio_pin_write(LED_1,0):&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="241" src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1525350049314v2.png" width="412" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;AFTER this&amp;nbsp;&lt;span style="color:#0000ff;"&gt;write()&lt;/span&gt;, value of reg remains the same...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 custom board: nrf_gpio_pin_write() does not work  (nor nrf_gpio_pin_clear())</title><link>https://devzone.nordicsemi.com/thread/130792?ContentTypeID=1</link><pubDate>Thu, 03 May 2018 11:47:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9afadb93-c143-4ae4-8478-4ca01bbcd7d6</guid><dc:creator>JohnM</dc:creator><description>&lt;p&gt;Well for my aplication, I&amp;#39;ve just taken the simple Blinky:&lt;/p&gt;
&lt;p&gt;C:\NORDIC\nRF5_SDK_12.3.0_d7731ad\examples\peripheral\blinky\pca10040\blank\arm5_no_packs\blinky_pca10040.uvprojx&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 custom board: nrf_gpio_pin_write() does not work  (nor nrf_gpio_pin_clear())</title><link>https://devzone.nordicsemi.com/thread/130785?ContentTypeID=1</link><pubDate>Thu, 03 May 2018 11:08:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc630397-9ff0-401c-92f5-dcf9d78903b1</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;This sounds a bit strange. I suspect there is something fishy with your application. Can you upload a short but complete application that demonstrate this? Also, can you read back the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/gpio.html?cp=2_1_0_19_2_0#register.OUT"&gt;OUT&lt;/a&gt; register after each write to see that it is set correctly?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>