<?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>Jitter when routing LFCLK on GPIO</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111250/jitter-when-routing-lfclk-on-gpio</link><description>Hi 
 I tried to route the LFCLK (32kHz LFXO) on a GPIO similar to the method that has been described here: 
 
 When I run the code on the nRF52832 everything works fine, i.e. I get the proper 16384 Hz signal without jitter. 
 But when I run the same code</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 May 2024 06:23:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111250/jitter-when-routing-lfclk-on-gpio" /><item><title>RE: Jitter when routing LFCLK on GPIO</title><link>https://devzone.nordicsemi.com/thread/484958?ContentTypeID=1</link><pubDate>Tue, 21 May 2024 06:23:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d90fbe59-4035-468b-9017-c5527607e07b</guid><dc:creator>Remo</dc:creator><description>&lt;p&gt;That&amp;#39;s an interesting issue you found :-) Thank you for the information.&lt;/p&gt;
&lt;p&gt;But I don&amp;#39;t think that this relates to my problem because I&amp;#39;m toggling the other GPIOs simply in a while-loop:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    nrf_gpio_pin_dir_set(24, NRF_GPIO_PIN_DIR_OUTPUT);
    nrf_gpio_pin_dir_set(26, NRF_GPIO_PIN_DIR_OUTPUT);
    while (true) {
        nrf_gpio_pin_toggle(24);
        nrf_gpio_pin_toggle(26);
    }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Jitter when routing LFCLK on GPIO</title><link>https://devzone.nordicsemi.com/thread/484830?ContentTypeID=1</link><pubDate>Fri, 17 May 2024 15:25:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39480a87-967a-4432-8ee9-750b419591e1</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Could you describe specifically how the application is toggling other GPIOs? I want to do some testing here as it will affect our project.&lt;/p&gt;
&lt;p&gt;I identified an issue a while back comparing nRF52832 and nRF52833, though that involved DMA transfers feeding GPIO, and received this answer from Nordic: &amp;quot;&lt;em&gt;... yes there is a change in nRF52833 compared in nRF52832. There is now a two stage AMLI bus system in nRF52833 instead of one (nRF52832). The reason we did not publish this is because we thought there should be no use cases where the application should directly see the difference. But you genius found the right use case with the right peripheral (PWM) where multi instance trigger at the same time is normal.&lt;/em&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;I found a workaround in that case by using separate AHB busses to different RAM blocks.&amp;nbsp;See&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/108397/pwm-anomaly-nrf52832-vs-nrf52833"&gt;pwm-anomaly-nrf52832-vs-nrf52833&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Jitter when routing LFCLK on GPIO</title><link>https://devzone.nordicsemi.com/thread/484828?ContentTypeID=1</link><pubDate>Fri, 17 May 2024 14:44:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee1ae427-c5ee-4931-81bb-55aeafbdfed9</guid><dc:creator>Remo</dc:creator><description>&lt;p&gt;Thanks for your answer. We could verify that the jitter only occurs when the application toggles also other GPIOs. &lt;/p&gt;
&lt;p&gt;But it doesn&amp;#39;t occur on the nRF52833-DK. So, it seems that we have some kind of corss-talk on our own HW.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Jitter when routing LFCLK on GPIO</title><link>https://devzone.nordicsemi.com/thread/484756?ContentTypeID=1</link><pubDate>Thu, 16 May 2024 16:13:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:482e9cd7-e906-4bc9-aed0-4fdd17ce13f3</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;I tested this code on the nRF52833DK and get a jitter of less than 1nSec with 32kHz crystal enabled:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Testing on nRF52833DK
#define RTC_TEST_PIN    14
void Test32kHzCrystal(void)
{
   // measure the frequency of the 32.768kHz crystal - will show as 16.384kHz, 17.484kHz RC typ or 6.7% error
   // 20ppm is +-0.655Hz in 32768Hz
   NRF_RTC_Type *pTickRTC = NRF_RTC2;
   // Select 32kHz clock source
   NRF_CLOCK-&amp;gt;LFCLKSRC = CLOCK_LFCLKSRC_SRC_Xtal &amp;lt;&amp;lt; CLOCK_LFCLKSRC_SRC_Pos;
   NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED = 0;
   // Start 32kHz clock
   NRF_CLOCK-&amp;gt;TASKS_LFCLKSTART = 1;
   while (NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED == 0) ;
   // Clear started event otherwise won&amp;#39;t sleep
   NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED = 0;
   NRF_P0-&amp;gt;OUTCLR = (1 &amp;lt;&amp;lt; RTC_TEST_PIN);
   // Configuration              Direction                Input                          Pullup                 Drive Level        Sense Level
   // =========================  =======================  =============================  =====================  =================  ====================
   nrf_gpio_cfg(RTC_TEST_PIN,    NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT, NRF_GPIO_PIN_NOPULL,   NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);
   // Select tick: 12 bit prescaler for COUNTER frequency (32768/(PRESCALER+1)). Must be written when RTC is stopped
   pTickRTC-&amp;gt;PRESCALER = 0;
   // Enable EVENTS_TICK generation
   pTickRTC-&amp;gt;EVTENSET = RTC_EVTENSET_TICK_Msk;
   // Start RTC
   pTickRTC-&amp;gt;TASKS_START = 1;
   // Configure GPIOTE to control output pin
   NRF_GPIOTE-&amp;gt;CONFIG[0] = GPIOTE_CONFIG_MODE_Task &amp;lt;&amp;lt; GPIOTE_CONFIG_MODE_Pos | GPIOTE_CONFIG_POLARITY_Toggle &amp;lt;&amp;lt; GPIOTE_CONFIG_POLARITY_Pos | RTC_TEST_PIN &amp;lt;&amp;lt; GPIOTE_CONFIG_PSEL_Pos;
   // Connect TICK event of the RTC to the output pin using PPI and GPIOTE, toggle so 32768/2=16384Hz expected
   NRF_PPI-&amp;gt;CH[0].EEP = (uint32_t)&amp;amp;pTickRTC-&amp;gt;EVENTS_TICK;
   NRF_PPI-&amp;gt;CH[0].TEP = (uint32_t)&amp;amp;NRF_GPIOTE-&amp;gt;TASKS_OUT[0];
   NRF_PPI-&amp;gt;CHEN = PPI_CHEN_CH0_Msk;
   while (1)
   {
        __SEV(); __WFE(); __WFE();
   }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>