<?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 direction bit is not working</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41103/gpio-direction-bit-is-not-working</link><description>I have problem with both custom boards and DEV board. 
 From a certain time after GPIO direction bit seems not effecting the pins. 
 To get rid of software factor, I all erase the flash and attach debugger, change register from it. 
 PIN_CNF[n]-&amp;gt;DIR </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 06 Dec 2018 03:01:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41103/gpio-direction-bit-is-not-working" /><item><title>RE: GPIO direction bit is not working</title><link>https://devzone.nordicsemi.com/thread/160490?ContentTypeID=1</link><pubDate>Thu, 06 Dec 2018 03:01:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:096a79d7-6d12-4b45-b2bd-fe54e49644d4</guid><dc:creator>akahira</dc:creator><description>&lt;p&gt;Problem solved.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;in short, I added CONFIG_NFCT_PINS_AS_GPIOS to preprocessor definition.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t set it before.&amp;nbsp;&amp;nbsp;I assume my dev board and BLE module was configured as GPIO as default.&lt;/p&gt;
&lt;p&gt;So I didn&amp;#39;t realize that that kind of settings does exist. I just thought the pins were damaged.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It was mentioned in the document here.&lt;/p&gt;
&lt;p&gt;&lt;a title="NFC antenna interface" href="https://www.nordicsemi.com/DocLib/Content/User_Guides/nrf52832_dk/latest/UG/nrf52_DK/hw_nfc"&gt;https://www.nordicsemi.com/DocLib/Content/User_Guides/nrf52832_dk/latest/UG/nrf52_DK/hw_nfc&lt;/a&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span class="note__title"&gt;Important:&lt;/span&gt;&lt;span&gt;&amp;nbsp;The NFC pins are enabled by default. NFC can be disabled and GPIOs enabled by defining the CONFIG_NFCT_PINS_AS_GPIOS variable in the project settings. This can be done by defining the preprocessor symbol in Keil, go to:&amp;nbsp;&lt;/span&gt;&lt;strong class="ph b"&gt;Project &amp;gt; Options for Target &amp;gt; C/C++ &amp;gt; Preprocessor Symbols &amp;gt; Define&lt;/strong&gt;&lt;span&gt;. Here you can add the CONFIG_NFCT_PINS_AS_GPIOS variable after NRF52.&lt;/span&gt;&lt;/p&gt;
&lt;p class="p" style="padding-left:30px;"&gt;This functionality can be removed by doing a nRFjprog --recover.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO direction bit is not working</title><link>https://devzone.nordicsemi.com/thread/159865?ContentTypeID=1</link><pubDate>Mon, 03 Dec 2018 07:18:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c216bc76-47a6-4027-a6cb-bcf65d1deda1</guid><dc:creator>akahira</dc:creator><description>&lt;p&gt;Hi, natersoz&lt;/p&gt;
&lt;p&gt;Thank you for the response.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I understand that GPIOTE will be take priority when it&amp;#39;s enabled.&lt;/p&gt;
&lt;p&gt;I checked it&amp;#39;s function with damaged (I assumed) pin and the other normal pins.&lt;/p&gt;
&lt;p&gt;Normal pins did work as expected. But the damaged pin didn&amp;#39;t work.&lt;/p&gt;
&lt;p&gt;Specifically, in task mode damaged pin won&amp;#39;t go High with POLARITY=LoToHi with set TASKS_SET[n].&lt;/p&gt;
&lt;p&gt;And in event mode, damaged pin detect won&amp;#39;t work (EVENTS_IN[n] remains 0x00000000).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Above are all checked after flash all erased and rebooted.&lt;/p&gt;
&lt;p&gt;Registers are operated from debugger (SES &amp;amp; J-Link Lite).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO direction bit is not working</title><link>https://devzone.nordicsemi.com/thread/159813?ContentTypeID=1</link><pubDate>Sat, 01 Dec 2018 20:09:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3ff2f19-c866-47c3-a8b3-a760716ddbc0</guid><dc:creator>natersoz</dc:creator><description>&lt;p&gt;Is it possible that your GPIO pins are being set to handle GPIOTE (events &amp;amp; tasks)?&lt;/p&gt;
&lt;p&gt;From chapter 21 of the nRF52 product specification:&lt;/p&gt;
&lt;div class="page" title="Page 157"&gt;
&lt;div class="layoutArea"&gt;
&lt;div class="column"&gt;
&lt;ol style="list-style-type:none;" start="0"&gt;
&lt;li&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;Helvetica&amp;#39;;font-size:14.000000pt;font-weight:bold;"&gt;21.1 Pin events and tasks &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;Helvetica&amp;#39;;font-size:10.000000pt;"&gt;The GPIOTE module has a number of tasks and events that can be configured to operate on individual GPIO pins. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;Helvetica&amp;#39;;font-size:10.000000pt;"&gt;The tasks (SET[n], CLR[n] and OUT[n]) can be used for writing to individual pins, and the events (IN[n]) can be generated from changes occurring at the inputs of individual pins. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;Helvetica&amp;#39;;font-size:10.000000pt;"&gt;The SET task will set the pin selected in CONFIG[n].PSEL to high. The CLR task will set the pin low. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;Helvetica&amp;#39;;font-size:10.000000pt;"&gt;The effect of the OUT task on the pin is configurable in CONFIG[n].POLARITY , and can either set the pin high, set it low, or toggle it. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;Helvetica&amp;#39;;font-size:10.000000pt;"&gt;The tasks and events are configured using the CONFIG[n] registers. Every set of SET, CLR and OUT[n] tasks and IN[n] events has one CONFIG[n] register associated with it. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-family:&amp;#39;Helvetica&amp;#39;;font-size:10.000000pt;"&gt;As long as a SET[n], CLR[n] and OUT[n] task or an IN[n] event is configured to control a pin &lt;/span&gt;&lt;span style="font-family:&amp;#39;Helvetica&amp;#39;;font-size:10pt;"&gt;n&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family:&amp;#39;Helvetica&amp;#39;;font-size:10.000000pt;"&gt;&lt;strong&gt;, the pin&amp;#39;s output value will only be updated by the GPIOTE module. The pin&amp;#39;s output value as specified in the GPIO will therefore be ignored as long as the pin is controlled by GPIOTE. Attempting to write a pin as a normal GPIO pin will have no effect. When the GPIOTE is disconnected from a pin, see MODE field in CONFIG[n] register, the associated pin will get the output and configuration values specified in the GPIO module.&lt;/strong&gt; &lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>