<?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>Dephasage on PWM</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/49181/dephasage-on-pwm</link><description>Hi, 
 I want to ask you, if they&amp;#39;re any phase locked loop (PLL) that can be used ? 
 My problem : I have two square signal generate by an Arduino Nano and a PWM on the nordic and I wanted to synchronise them (they have the same frequency). I tried with</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 02 Jul 2019 15:42:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/49181/dephasage-on-pwm" /><item><title>RE: Dephasage on PWM</title><link>https://devzone.nordicsemi.com/thread/196055?ContentTypeID=1</link><pubDate>Tue, 02 Jul 2019 15:42:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:469154f5-574d-4cb3-ab16-d213826b95e9</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;For PWM synchronization use-cases, it&amp;rsquo;s generally better to use the PWM driver (easier to use PPI with the PWM driver / dedicated PWM peripheral). The connect GPIOTE event with PWM TASKS_SEQSTART[0] task. &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/hardware_driver_ppi.html?cp=5_1_2_0_7"&gt;Here is link &lt;/a&gt;to PPI driver doc. If you don&amp;#39;t use the driver, it&amp;#39;s also possible to do it bare-metal, see &lt;a href="https://github.com/andenore/NordicSnippets/blob/master/examples/ppi/main.c"&gt;this example&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dephasage on PWM</title><link>https://devzone.nordicsemi.com/thread/195725?ContentTypeID=1</link><pubDate>Mon, 01 Jul 2019 14:53:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1c20e7f-e926-468d-80b8-54412839a510</guid><dc:creator>EliasAd</dc:creator><description>&lt;p&gt;The PWM Library&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dephasage on PWM</title><link>https://devzone.nordicsemi.com/thread/195722?ContentTypeID=1</link><pubDate>Mon, 01 Jul 2019 14:47:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66d061c4-1ffc-493a-8207-d070cab7e810</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Are you using the PWM driver or the PWM library ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dephasage on PWM</title><link>https://devzone.nordicsemi.com/thread/195706?ContentTypeID=1</link><pubDate>Mon, 01 Jul 2019 14:21:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b43f076-3e06-4c07-893d-9915ffcfaf51</guid><dc:creator>EliasAd</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt; if(!nrf_gpio_pin_latch_get(PINTRANSZERO)){ //Sense_LOW of the pin
    if((previous_state)){
      count++; //count number of falling edge
    }
    nrf_gpio_pin_set(LED3);
    previous_state = 0;
 }else{
    nrf_gpio_pin_clear(LED3);
    previous_state = 1;
 }
 nrf_gpio_pin_latch_clear(PINTRANSZERO);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I done this for detect a falling edge.&lt;/p&gt;
&lt;p&gt;Where can I find an example of the configuration of the start.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dephasage on PWM</title><link>https://devzone.nordicsemi.com/thread/195689?ContentTypeID=1</link><pubDate>Mon, 01 Jul 2019 13:52:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15a50818-23d5-4e75-8066-83d35dfa3d8c</guid><dc:creator>Sigurd</dc:creator><description>[quote user="EliasAd"]The PWM will continue from it previous state or restart&amp;nbsp;as a new one ?[/quote]
&lt;p&gt;It will restart, but you can configure if it should start high or low.&lt;/p&gt;
[quote user="EliasAd"]It almost work[/quote]
&lt;p&gt;&amp;nbsp;Almost ?&lt;/p&gt;
&lt;p&gt;Could you post some code on how you did it ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dephasage on PWM</title><link>https://devzone.nordicsemi.com/thread/195644?ContentTypeID=1</link><pubDate>Mon, 01 Jul 2019 12:45:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9dc5051-98e5-45e6-b59d-84ff1d0d6a74</guid><dc:creator>EliasAd</dc:creator><description>&lt;p&gt;I just tried it. It almost work. Do you know if I disable the pwm and then enable it, The PWM will continue from it previous state or restart&amp;nbsp;as a new one ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dephasage on PWM</title><link>https://devzone.nordicsemi.com/thread/195635?ContentTypeID=1</link><pubDate>Mon, 01 Jul 2019 12:33:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7ec78d0-e91d-4d11-a5ed-ef46c269b8e0</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;An option could be to capture the PWM from the Arduino on one of the GPIOs on the nRF52, then use PPI to start the PWM on the nRF52 when you get a GPIOTE event(falling or raising edge).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>