<?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>Setting XL1 &amp;amp; XL2 as GPIO does not work.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35205/setting-xl1-xl2-as-gpio-does-not-work</link><description>Hi there, We are not using external Crystal for this design and thinking of reusing XL1 &amp;amp; XL2 (Pin 0 and Pin 1) for SPI (MISO &amp;amp; MOSI). But I found that I can&amp;#39;t set properly set these pins as GPIO output. Something as simple as: 
 nrf_gpio_cfg_output(0</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 21 Dec 2018 20:21:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35205/setting-xl1-xl2-as-gpio-does-not-work" /><item><title>RE: Setting XL1 &amp; XL2 as GPIO does not work.</title><link>https://devzone.nordicsemi.com/thread/162887?ContentTypeID=1</link><pubDate>Fri, 21 Dec 2018 20:21:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b18a84b-b759-4ca1-a6d1-386f8cc0e1fc</guid><dc:creator>martijnthe</dc:creator><description>&lt;p&gt;When using the current SDK (15.2) and the SoftDevice, you probably also&amp;nbsp;need to set the `NRF_SDH_CLOCK_LF_SRC` to 0, as well as configure the related `&lt;span&gt;NRF_SDH_CLOCK_LF_...` configuration options.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Setting XL1 &amp; XL2 as GPIO does not work.</title><link>https://devzone.nordicsemi.com/thread/135816?ContentTypeID=1</link><pubDate>Wed, 13 Jun 2018 00:55:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f69bc50-ebf7-4318-9c5a-08376424cf06</guid><dc:creator>Cecylia</dc:creator><description>&lt;p&gt;I&amp;#39;m using custom HW.&amp;nbsp; I did not explicitly set the source ---or so I thought--- but the sdk_config.h that I copied over apparently set it to XTAL.&amp;nbsp; So when I called &amp;#39;nrf_drv_clock_init()&amp;#39; then it sets it to XTAL instead of RC.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When I change this&amp;nbsp;&lt;span&gt;CLOCK_CONFIG_LF_SRC&amp;nbsp; to 0 then I can use XL0 and XL1.&amp;nbsp; Yay!&amp;nbsp; Thanks!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;// &amp;lt;o&amp;gt; CLOCK_CONFIG_LF_SRC - LF Clock Source&lt;br /&gt; &lt;br /&gt;// &amp;lt;0=&amp;gt; RC &lt;br /&gt;// &amp;lt;1=&amp;gt; XTAL &lt;br /&gt;// &amp;lt;2=&amp;gt; Synth&lt;/p&gt;
&lt;p&gt;#ifndef CLOCK_CONFIG_LF_SRC&lt;br /&gt;#define CLOCK_CONFIG_LF_SRC 1&lt;br /&gt;#endif&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Setting XL1 &amp; XL2 as GPIO does not work.</title><link>https://devzone.nordicsemi.com/thread/135815?ContentTypeID=1</link><pubDate>Wed, 13 Jun 2018 00:53:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64b876ea-06cc-4857-8fed-d749129b5a19</guid><dc:creator>Cecylia</dc:creator><description>&lt;p&gt;Thanks for clarifying!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Setting XL1 &amp; XL2 as GPIO does not work.</title><link>https://devzone.nordicsemi.com/thread/135742?ContentTypeID=1</link><pubDate>Tue, 12 Jun 2018 12:26:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3120d261-c4ee-4b4f-8d3e-8b3a9b11d61e</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Hi, yes you have to make sure that &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52840.ps/clock.html?cp=2_0_0_4_3_2_7#register.LFCLKSRC"&gt;LFCLKSRC &lt;/a&gt;is set to 0. If you haven&amp;#39;t set this register in your project it defaults to 0 already.&lt;/p&gt;
&lt;p&gt;Are you using custom HW or the PCA10056 DK? If you are using the DK pin 0 and 1 are routed to the crystal and you need to cut SB1/2 and solder SB3/4 in order to route the pins out to the GPIO header. Please check out the &lt;a href="https://www.nordicsemi.com/eng/nordic/Products/nRF52840-DK/nRF52840-DK-HW/68048"&gt;schematics &lt;/a&gt;or &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52/dita/nrf52/development/nrf52840_pdk/solder_bridge.html?cp=2_0_3_7_14"&gt;this list&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Setting XL1 &amp; XL2 as GPIO does not work.</title><link>https://devzone.nordicsemi.com/thread/135677?ContentTypeID=1</link><pubDate>Tue, 12 Jun 2018 07:41:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33efad1b-b5ba-478d-95af-51e4005a3cb5</guid><dc:creator>robert</dc:creator><description>&lt;p&gt;The principle of nRF52 GPIO shared pin is: when a pin&amp;nbsp;is enabled for certain function, the GPIO function is automatically disabled. So, when LFCLK is using external crystal, pin-0 and pin-1 GPIO function will be disabled automatically. That means you have to&amp;nbsp;prevent LFCLK from using external crystal.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Setting XL1 &amp; XL2 as GPIO does not work.</title><link>https://devzone.nordicsemi.com/thread/135656?ContentTypeID=1</link><pubDate>Tue, 12 Jun 2018 04:49:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:173e14ff-f192-40ee-b203-c4f8fd0f94e9</guid><dc:creator>Cecylia</dc:creator><description>&lt;p&gt;Hi @hmolesworth, thanks for the answer. &amp;nbsp;I don&amp;#39;t have any &amp;quot;&lt;span&gt;(NRF_CLOCK-&amp;gt;LFCLKSRC)&amp;quot; anywhere in my project. &amp;nbsp;Do you have specific example project in mind for me to search those?&lt;br /&gt;Specifically the comments &amp;quot;// 32kHz Osc pins can be used as GPIOs or 32kHz Oscillator, special case&amp;quot; that might give me clearer clues.&lt;br /&gt;&lt;br /&gt;From what you wrote, though, does it mean that if I set&amp;nbsp;LFCLKSRC to 0 then the&amp;nbsp;pins are free for GPIO?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Setting XL1 &amp; XL2 as GPIO does not work.</title><link>https://devzone.nordicsemi.com/thread/135275?ContentTypeID=1</link><pubDate>Fri, 08 Jun 2018 02:21:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4764f114-1c55-4e71-8967-6de99a419368</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;I can give you a clue:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    // 32kHz Osc pins can be used as GPIOs or 32kHz Oscillator, special case
    if ( (PinId == RCC_OSC_OUT_PIN) &amp;amp;&amp;amp; (NRF_CLOCK-&amp;gt;LFCLKSRC &amp;amp; 0x000001) ) return &amp;quot;RTC-OSC-OUT&amp;quot;;
    if ( (PinId == RCC_OSC_IN_PIN)  &amp;amp;&amp;amp; (NRF_CLOCK-&amp;gt;LFCLKSRC &amp;amp; 0x000001) ) return &amp;quot;RTC-OSC-IN&amp;quot;;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Search for this (NRF_CLOCK-&amp;gt;LFCLKSRC) and you can see how to enable the pins for port io&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>