<?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>Is it possible to use P0.00 and P0.01 for I2C? I&amp;#39;m using RTC for LFCLK, so I thought these would be available as GPIO.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42079/is-it-possible-to-use-p0-00-and-p0-01-for-i2c-i-m-using-rtc-for-lfclk-so-i-thought-these-would-be-available-as-gpio</link><description>I&amp;#39;ve designed a custom board for the NRF52832. Current consumption is not a major concern, and the pin location was convenient, so I wanted to use P0.00 and P0.01 for I2C. I&amp;#39;ve set the LFCLK to the RTC, and so I thought it would be OK to use those pins</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 03 Jan 2019 06:12:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42079/is-it-possible-to-use-p0-00-and-p0-01-for-i2c-i-m-using-rtc-for-lfclk-so-i-thought-these-would-be-available-as-gpio" /><item><title>RE: Is it possible to use P0.00 and P0.01 for I2C? I'm using RTC for LFCLK, so I thought these would be available as GPIO.</title><link>https://devzone.nordicsemi.com/thread/163638?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 06:12:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:417292a3-cc87-49e6-b5f5-2356fc04ba12</guid><dc:creator>James H</dc:creator><description>&lt;p&gt;I&amp;#39;m using the Arduino core in PlatformIO, but following your suggestion I added this during configuration and it is now working. clockState and clockSource are temporary global variables I can watch in the debugger as I don&amp;#39;t have UART connected. I can see the clock source change, although the clock never starts even though the start trigger shows up. I then can communicate with the I2C device.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if (clockState) {
      NRF_CLOCK-&amp;gt;TASKS_LFCLKSTOP = 1;
      while(NRF_CLOCK-&amp;gt;LFCLKSTAT);
    }
    clockState = NRF_CLOCK-&amp;gt;LFCLKSTAT;
    clockSource = NRF_CLOCK-&amp;gt;LFCLKSRCCOPY;
    NRF_CLOCK-&amp;gt;LFCLKSRC = CLOCK_LFCLKSRC_SRC_RC;  
    NRF_CLOCK-&amp;gt;TASKS_LFCLKSTART = 1;
    clockRun = NRF_CLOCK-&amp;gt;LFCLKRUN;
    while(!NRF_CLOCK-&amp;gt;LFCLKSTAT);
    clockState = NRF_CLOCK-&amp;gt;LFCLKSTAT;
    clockSource = NRF_CLOCK-&amp;gt;LFCLKSRCCOPY;
   }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is it possible to use P0.00 and P0.01 for I2C? I'm using RTC for LFCLK, so I thought these would be available as GPIO.</title><link>https://devzone.nordicsemi.com/thread/163590?ContentTypeID=1</link><pubDate>Wed, 02 Jan 2019 22:26:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39a8e9f1-da3e-41c9-a7c2-fb075708207f</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Similar post I responded to&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/35205/setting-xl1-xl2-as-gpio-does-not-work"&gt;here&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is it possible to use P0.00 and P0.01 for I2C? I'm using RTC for LFCLK, so I thought these would be available as GPIO.</title><link>https://devzone.nordicsemi.com/thread/163584?ContentTypeID=1</link><pubDate>Wed, 02 Jan 2019 21:55:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a32416ad-ae71-4c52-a0db-cb1d6c2c5537</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Did you try the code I posted above? This is (typically) the default code, pins used for crystal not io; how are you setting LFCLK?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// &amp;lt;o&amp;gt; CLOCK_CONFIG_LF_SRC  - LF Clock Source

// &amp;lt;0=&amp;gt; RC
// &amp;lt;1=&amp;gt; XTAL
// &amp;lt;2=&amp;gt; Synth

#ifndef CLOCK_CONFIG_LF_SRC
#define CLOCK_CONFIG_LF_SRC 1
#endif

nrf_clock_lf_src_set((nrf_clock_lfclk_t)CLOCK_CONFIG_LF_SRC);
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The board .h default (for PCA10040 for example):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Low frequency clock source to be used by the SoftDevice
#define NRF_CLOCK_LFCLKSRC      {.source        = NRF_CLOCK_LF_SRC_XTAL,            \
                                 .rc_ctiv       = 0,                                \
                                 .rc_temp_ctiv  = 0,                                \
                                 .accuracy     = NRF_CLOCK_LF_ACCURACY_20_PPM}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is it possible to use P0.00 and P0.01 for I2C? I'm using RTC for LFCLK, so I thought these would be available as GPIO.</title><link>https://devzone.nordicsemi.com/thread/163572?ContentTypeID=1</link><pubDate>Wed, 02 Jan 2019 21:14:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:339d1088-3fff-4b58-acf2-6f83f07248ca</guid><dc:creator>James H</dc:creator><description>&lt;p&gt;I have set the LFCLK to use the internal oscillator, but that doesn&amp;#39;t seem to be all that is needed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is it possible to use P0.00 and P0.01 for I2C? I'm using RTC for LFCLK, so I thought these would be available as GPIO.</title><link>https://devzone.nordicsemi.com/thread/163567?ContentTypeID=1</link><pubDate>Wed, 02 Jan 2019 21:00:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbafd2cc-7d7c-448d-9003-acd6c7226c5c</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Those pins are for the 32KHz crystal of the RTC but default. &amp;nbsp;If you want to use those pins as gpio, you need to remap them and use internal RC for your timer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is it possible to use P0.00 and P0.01 for I2C? I'm using RTC for LFCLK, so I thought these would be available as GPIO.</title><link>https://devzone.nordicsemi.com/thread/163537?ContentTypeID=1</link><pubDate>Wed, 02 Jan 2019 18:08:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df301f1e-1685-4651-8009-14ec7b20ddb4</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Worth checking the settings, have a look at this code:&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;Typically the pins are set to RTC mode by functions invoked by this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    // Configure RTC
    lfclk_config();

__STATIC_INLINE void nrf_clock_lf_src_set(nrf_clock_lfclk_t source)
{
    NRF_CLOCK-&amp;gt;LFCLKSRC =
        (uint32_t)((source &amp;lt;&amp;lt; CLOCK_LFCLKSRC_SRC_Pos) &amp;amp; CLOCK_LFCLKSRC_SRC_Msk);
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>