<?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>NFC as GPIO</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/40045/nfc-as-gpio</link><description>Hello, 
 I&amp;#39;m using the same SDK used on the Thingy:52, compiling with GCC. I&amp;#39;m using the Rigado BMD-350-A which uses the nrf52832. 
 I&amp;#39;d like to use P0.09 and P0.10 as GPIO instead of NFC. I&amp;#39;ve added CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS=1 (I&amp;#39;ve done</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 17 Apr 2019 14:26:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/40045/nfc-as-gpio" /><item><title>RE: NFC as GPIO</title><link>https://devzone.nordicsemi.com/thread/182645?ContentTypeID=1</link><pubDate>Wed, 17 Apr 2019 14:26:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c7436cf-172d-4191-8046-e5ede6f3cea9</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Documentation links here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/37682/po-09-configure-as-digital-input-button/182644#182644"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/37682/po-09-configure-as-digital-input-button/182644#182644&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NFC as GPIO</title><link>https://devzone.nordicsemi.com/thread/155605?ContentTypeID=1</link><pubDate>Thu, 01 Nov 2018 15:15:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70fe926a-e5d2-48bd-9a4b-ec3848df2872</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;The solution you propose should only be used if a bit requires changing, and not on every reset.&amp;nbsp;&lt;/p&gt;
&lt;div class="content full threaded-reply-content user-defined-markup"&gt;
&lt;div class="content"&gt;
&lt;p&gt;Be aware of&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;nWRITE&lt;/em&gt;. The &lt;em&gt;UICR&lt;/em&gt; register is part of the Flash memory, and it must not be repeatedly written (max 181 times) as it would be by an indiscriminate register write in user code on every reset. The Nordic &lt;em&gt;SystemInit()&lt;/em&gt; checks the value before writing when using the defines to avoid repeated writes. This also means - for example - that the NFC pins can not be easily repeatedly switched between NFC mode and I/O port mode.&lt;/p&gt;
&lt;p&gt;I quote:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;11.3 Writing to user information configuration registers (UICR)&lt;/em&gt;&lt;br /&gt;&lt;em&gt;User information configuration registers (UICR) are written in the same way as Flash. After UICR has been&amp;nbsp;&lt;/em&gt;&lt;em&gt;written, the new UICR configuration will only take effect after a reset.&lt;/em&gt;&lt;br /&gt;&lt;em&gt;UICR can only be written nWRITE number of times before an erase must be performed using ERASEUICR or&amp;nbsp;&lt;/em&gt;&lt;em&gt;ERASEALL.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;nWRITE,BLOCK Amount of writes allowed in a block between erase 181&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="edit-form"&gt;&lt;/div&gt;
&lt;div class="actions meta default"&gt;
&lt;div class="navigation-list"&gt;
&lt;div class="container"&gt;
&lt;ul&gt;
&lt;li class="navigation-list-item vote"&gt;&lt;span class="votes"&gt;&lt;a class="ui-tip vote up " href="https://devzone.nordicsemi.com/f/nordic-q-a/34262/system-reset-after-uicr-erase-and-write-leads-to-system-off"&gt;Up&lt;/a&gt;&lt;span class="vote current ui-tip"&gt;0&lt;/span&gt;&lt;a class="ui-tip vote down " href="https://devzone.nordicsemi.com/f/nordic-q-a/34262/system-reset-after-uicr-erase-and-write-leads-to-system-off"&gt;Down&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NFC as GPIO</title><link>https://devzone.nordicsemi.com/thread/155563?ContentTypeID=1</link><pubDate>Thu, 01 Nov 2018 13:19:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9a7535a-6ad6-4539-8b5e-c5834f09b9a3</guid><dc:creator>cprehn</dc:creator><description>&lt;p&gt;I found a solution that worked for me.&amp;nbsp; I put this code block in the main function.&amp;nbsp; I found it &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/13742/is-there-sample-code-for-writing-to-an-uicr-register"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/* MWU Enable -- This is workaround suggested by Aryan on the Nordic Developer Zone */
NRF_MWU-&amp;gt;REGIONENSET
    = ((MWU_REGIONENSET_RGN0WA_Set &amp;lt;&amp;lt; MWU_REGIONENSET_RGN0WA_Pos) 
     | (MWU_REGIONENSET_PRGN0WA_Set &amp;lt;&amp;lt; MWU_REGIONENSET_PRGN0WA_Pos));

/* Turn on flash write enable and wait until the NVMC is ready: */
NRF_NVMC-&amp;gt;CONFIG = (NVMC_CONFIG_WEN_Wen &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos);
while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy){}

/* write to the register */
NRF_UICR-&amp;gt;NFCPINS = 0xFFFFFFFE;
while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy){}
    
/* Turn off flash write enable and wait until the NVMC is ready: */
NRF_NVMC-&amp;gt;CONFIG = (NVMC_CONFIG_WEN_Ren &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos);
while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy){}
    
/* MWU Disable -- This is workaround suggested by Aryan on the Nordic Developer Zone */
NRF_MWU-&amp;gt;REGIONENCLR
    = ((MWU_REGIONENCLR_RGN0WA_Clear &amp;lt;&amp;lt; MWU_REGIONENCLR_RGN0WA_Pos) 
     | (MWU_REGIONENCLR_PRGN0WA_Clear &amp;lt;&amp;lt; MWU_REGIONENCLR_PRGN0WA_Pos));
            &lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NFC as GPIO</title><link>https://devzone.nordicsemi.com/thread/155415?ContentTypeID=1</link><pubDate>Wed, 31 Oct 2018 16:33:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbf912c8-facb-4746-ad27-f0871aab359b</guid><dc:creator>cprehn</dc:creator><description>&lt;p&gt;&lt;em&gt;P0.09 and P0.10:&lt;/em&gt; The NFC pins&amp;nbsp;can be assigned for any other purpose provided their setup is changed.&amp;nbsp;A permanent shunt exists between these pins to protect the nRF52 from damage when used for NFC. To minimize leakage current, ensure these two pins are at the same level when not in use.&lt;/p&gt;
&lt;p&gt;Got that from &lt;a href="https://rigado.zendesk.com/hc/en-us/articles/225362747-BMD-300-BMD-301-BMD-330-BMD-340-BMD-350-pin-assignments"&gt;here&lt;/a&gt;.&amp;nbsp; I haven&amp;#39;t seen anything from Rigado that mentions a way to change the hardware, but they imply that the pins are still usable as GPIO.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NFC as GPIO</title><link>https://devzone.nordicsemi.com/thread/155413?ContentTypeID=1</link><pubDate>Wed, 31 Oct 2018 16:25:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1db15b41-58c7-4f0b-94e0-d812eb2b9674</guid><dc:creator>awneil</dc:creator><description>[quote userid="71764" url="~/f/nordic-q-a/40045/nfc-as-gpio"]I&amp;#39;m using the Rigado BMD-350-A[/quote]
&lt;p&gt;Have you checked the Rigado documentation to see if their particular hardware implementation would affect this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>