<?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>Shouldn&amp;#39;t this function below output 2us Pulses, instead of outing 3us!</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47631/shouldn-t-this-function-below-output-2us-pulses-instead-of-outing-3us</link><description>Hello 
 I am using nRF52 DK, I am trying to use PIN 30 as Pulse train. The following while loop is expected to send out Pulse train of 2microseconds period but instead, it is giving me 3-microsecond pulse width. which is weird or what is that I am missing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 23 May 2019 12:30:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47631/shouldn-t-this-function-below-output-2us-pulses-instead-of-outing-3us" /><item><title>RE: Shouldn't this function below output 2us Pulses, instead of outing 3us!</title><link>https://devzone.nordicsemi.com/thread/188823?ContentTypeID=1</link><pubDate>Thu, 23 May 2019 12:30:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d541c40-8727-4917-a48b-83ed3ccd8c4f</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;The TIMER, PPI, and GPIOTE peripherals operates on a 16MHz clock, that means that the PPI will trigger a GPIOTE task based on a TIMER event one 16MHz clock cycle later (62.5ns), and I believe the GPIOTE peripheral uses one clock cycle to change a pin state.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;In short, you should se a 125ns delay from a TIMER event to a GPIOTE pin change. Do note that any loading of the pin will change the slew rate.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can also use the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/rtc.html?cp=3_1_0_24#concept_rvn_vkj_sr"&gt;RTC — Real-time counter&lt;/a&gt;&amp;nbsp;instead of the TIMER, but your time resolution will be 1/32.768kHz = 30.51µs instead of 62.5ns.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;Alternatively you can use the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/pwm.html?cp=3_1_0_46#concept_pzc_1pw_nr"&gt;PWM — Pulse width modulation&lt;/a&gt;&amp;nbsp;peripheral.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Shouldn't this function below output 2us Pulses, instead of outing 3us!</title><link>https://devzone.nordicsemi.com/thread/188785?ContentTypeID=1</link><pubDate>Thu, 23 May 2019 10:06:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:524f11ae-bc3b-449d-a6f1-27b23ace7913</guid><dc:creator>AimHigh</dc:creator><description>&lt;p&gt;I got your point, I noticed that GPIO is giving me an approximate pulse when in milliseconds. Would you mind to tell me what is the accuracy for PWM generated through TIMER+PPI+GPIOTE? So that I could decide whether to go for a seperate time to digital converter or use nRF52832 peripherals. and thanks for that response.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Shouldn't this function below output 2us Pulses, instead of outing 3us!</title><link>https://devzone.nordicsemi.com/thread/188717?ContentTypeID=1</link><pubDate>Thu, 23 May 2019 07:55:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7da23a04-f75c-43ee-86c4-fe3b164263a8</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;You&amp;#39;re missing execution delays, the&amp;nbsp;&lt;span&gt;nrf_delay_us() function is not entirely accurate, probably the least accurate at its lowest input value. It&amp;#39;s implemented as assembly &amp;#39;No Operation&amp;#39; instructions.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also the gpio functions has CPU execution time as well as the time-delay it takes to change the state of the pin.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;If you want an accurate pwm signal you need to use TIMER+ PPI +GPIOTE. See the&amp;nbsp;PPI&amp;nbsp;example for details.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>