<?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>RTC jittering and lacking control of frequency</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29722/rtc-jittering-and-lacking-control-of-frequency</link><description>I am using the RTC to generate a square wave signal. 
 I have two issues. One is that nothing I do on the prescaler or the Count Compare is having an influence on the frequency produced.
The other is that I have significant jitter on the time axis </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 24 Jan 2018 12:37:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29722/rtc-jittering-and-lacking-control-of-frequency" /><item><title>RE: RTC jittering and lacking control of frequency</title><link>https://devzone.nordicsemi.com/thread/117912?ContentTypeID=1</link><pubDate>Wed, 24 Jan 2018 12:37:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eed5a38a-a8ca-493e-8f0f-4a504df82f11</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;@RK: To be fair, he mentions nRF51 in the tags in his question.&lt;/p&gt;
&lt;p&gt;@stephbur: Another thing that is missing in the code in your question is the enabling of your PPI channels. Try to add this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_PPI-&amp;gt;CHEN = (PPI_CHEN_CH1_Enabled &amp;lt;&amp;lt; PPI_CHEN_CH1_Pos) | (PPI_CHEN_CH2_Enabled &amp;lt;&amp;lt; PPI_CHEN_CH2_Pos);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I tested your code on an nRF51 DK and toggled LED_4. It worked fine. Output frequency was a stable 321.3Hz. The random square waves are pretty odd though. Are you sure you are not measuring on your SPI bus or something? It could be some sort of serial signals.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC jittering and lacking control of frequency</title><link>https://devzone.nordicsemi.com/thread/117915?ContentTypeID=1</link><pubDate>Wed, 24 Jan 2018 08:39:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce4f92b5-83a6-41c6-bf76-f91844836999</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;well the rest looks fine to me now you added those two. So what pin are you using, is it already used for something else, are you sure you&amp;#39;re actually measuring the right thing because you should get absolutely nothing at all or the correct thing. The random noise makes no sense at all and I can&amp;#39;t  even really tell what the scale is on that plot. You don&amp;#39;t say which chip you&amp;#39;re using either by the way which you always should. eg if you&amp;#39;re using the nRF52 and have selected pin 9 or 10, you just picked the NFC pin and could get just about anything.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC jittering and lacking control of frequency</title><link>https://devzone.nordicsemi.com/thread/117914?ContentTypeID=1</link><pubDate>Wed, 24 Jan 2018 08:08:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffee1261-ae16-42db-8640-e745b1896ead</guid><dc:creator>stephbur</dc:creator><description>&lt;p&gt;I had the rtc start in there but must have somehow lost it while playing around with the code. I added it and it does not change anything. I also added the line NRF_RTC1-&amp;gt;EVTENSET = RTC_EVTENSET_COMPARE0_Msk;
But still the outcome is the same.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC jittering and lacking control of frequency</title><link>https://devzone.nordicsemi.com/thread/117913?ContentTypeID=1</link><pubDate>Wed, 24 Jan 2018 07:50:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:003052a2-14e1-4e51-a892-67d42fe0073e</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;well for a start nowhere in that code do you actually start the RTC timer. Nor enable the counter events either (EVTEN)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>