<?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>nRF52 wirting GPIOS direct with immediate effect</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19850/nrf52-wirting-gpios-direct-with-immediate-effect</link><description>Hi
I have ported a simple function from nRF51 to nRF52 which Outputs PWM coded Startup Diagnose Information via a GPIO.
The Timing is generated by wait Loops and GPIO will be toggled by direct writing to OUTSET Register.
I have noticed that the Timing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 24 Feb 2017 13:20:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19850/nrf52-wirting-gpios-direct-with-immediate-effect" /><item><title>RE: nRF52 wirting GPIOS direct with immediate effect</title><link>https://devzone.nordicsemi.com/thread/77201?ContentTypeID=1</link><pubDate>Fri, 24 Feb 2017 13:20:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21864284-d0b9-4aa2-a982-80f47de32a3a</guid><dc:creator>prpaul</dc:creator><description>&lt;p&gt;Hi
I have solved the problem by implementing the function using a Timer, PPI channels and GPIOTE as you have proposed.
Thank you very much.
Paul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 wirting GPIOS direct with immediate effect</title><link>https://devzone.nordicsemi.com/thread/77200?ContentTypeID=1</link><pubDate>Tue, 21 Feb 2017 11:27:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba936c31-7c14-45dd-872b-1e22378749a8</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The GPIO peripheral runs off the &lt;em&gt;16MHz peripheral clock&lt;/em&gt; while the CPU runs off the &lt;em&gt;64MHz CPU clock&lt;/em&gt;, so the timing will be determined by this. See &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=2_2_0_18#frontpage_clock"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you want exact timing you should consider using PPI and GPIOTE. You should also enable &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=2_2_0_17_2_0#unique_639533938"&gt;constant latency mode&lt;/a&gt; so that CPU wakeup latency and the PPI task response will be constant and kept at a minimum. The drawback of this is that some resources are forced on while in sleep so the current consumption will increase. Enable the constant latency mode like this (not SoftDevice safe):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_POWER-&amp;gt;TASK_CONSTLAT = 1;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You may also want to use the crystal clock instead of the internal oscillator as this has much better accuracy. Start the clock like this (not SoftDevice safe):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;
NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;
while(NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There is some delay when using PPI and GPIOTE, but this should be constant when using constant latency mode.&lt;/p&gt;
&lt;p&gt;Ole&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>