<?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>Interrupt on both PWM edges</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/28641/interrupt-on-both-pwm-edges</link><description>Hi
Im using the pwm in the NRF52 with the following function:
APP_ERROR_CHECK(nrf_drv_pwm_init(&amp;amp;m_pwm2, &amp;amp;config2, pwm2_handler)); 
 in the Interrupt function &amp;quot;pwm2_handler&amp;quot; I receive an Interrupt after each full PWM cycle. Is there a possibility to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 20 Dec 2017 15:12:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/28641/interrupt-on-both-pwm-edges" /><item><title>RE: Interrupt on both PWM edges</title><link>https://devzone.nordicsemi.com/thread/113519?ContentTypeID=1</link><pubDate>Wed, 20 Dec 2017 15:12:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ae18392-f674-444e-a33e-14b878e28a6b</guid><dc:creator>machfax</dc:creator><description>&lt;p&gt;Jorgen, thnak you I will do it tomorrow, I have to work on the statemachine and after I will implement this PPI with DMA, thanks in advance&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interrupt on both PWM edges</title><link>https://devzone.nordicsemi.com/thread/113518?ContentTypeID=1</link><pubDate>Wed, 20 Dec 2017 14:47:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:266ec183-0095-4376-b3ed-da58dbfae548</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Yes, PPI should work for this. Please have a look at the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.2.0/ppi_example.html?cp=4_0_0_4_6_20"&gt;PPI example&lt;/a&gt; in the SDK for details on how to configre PPI.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interrupt on both PWM edges</title><link>https://devzone.nordicsemi.com/thread/113517?ContentTypeID=1</link><pubDate>Wed, 20 Dec 2017 09:42:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c4ed843-8fef-4538-baa0-5568d4f52d47</guid><dc:creator>machfax</dc:creator><description>&lt;p&gt;Yes PPI sorry. I think I need to use the PPI to do this. right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interrupt on both PWM edges</title><link>https://devzone.nordicsemi.com/thread/113516?ContentTypeID=1</link><pubDate>Tue, 19 Dec 2017 21:26:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:944b8598-76ce-404f-a74e-5b66a3f9bc43</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;What do you mean by DMA? &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/easydma.html?cp=2_1_0_9#easydma"&gt;EasyDMA&lt;/a&gt; is used for peripherals to have direct access to data in memory. Did you mean &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/ppi.html?cp=2_1_0_21#concept_sxf_21l_1s"&gt;PPI&lt;/a&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interrupt on both PWM edges</title><link>https://devzone.nordicsemi.com/thread/113515?ContentTypeID=1</link><pubDate>Tue, 19 Dec 2017 13:12:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5bd8244f-ac2e-4173-9b56-60d55766fda2</guid><dc:creator>machfax</dc:creator><description>&lt;p&gt;Hi Jorgen&lt;/p&gt;
&lt;p&gt;Thank you for the information.
I think I need to use the DMA functuion like this:&lt;/p&gt;
&lt;p&gt;NRF_PWM[x]-&amp;gt;EVENTS_PWMPeriod  -&amp;gt; NRF_TIMER[y]-&amp;gt;TASKS_START
NRF_TIMER[y]-&amp;gt;EVENTS_COMPARE[0] -&amp;gt; NRF_SAADC-&amp;gt;TASKS_START
NRF_TIMER[y]-&amp;gt;EVENTS_COMPARE[1] -&amp;gt;NRF_SAADC-&amp;gt;TASKS_START&lt;/p&gt;
&lt;p&gt;Did anybody know an example to configure the EasyDMA for this events above.
Or can somebody tell me wehere is the discription to set the EasyDMA Mode correctly.&lt;/p&gt;
&lt;p&gt;Thanks a lot&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interrupt on both PWM edges</title><link>https://devzone.nordicsemi.com/thread/113514?ContentTypeID=1</link><pubDate>Tue, 19 Dec 2017 12:50:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be4e31b1-2958-4a26-8320-2855ec2f4f6d</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The available events from the PWM peripheral is described &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/group__nrf__pwm__hal.html#ga4a8ceac653433e4ac8ee8682bdef45bf"&gt;here&lt;/a&gt;. As you see, there are no event on rising or falling edge. However, you should be able to achieve this using GPIOTE. The GPIOTE peripheral can be &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.2.0/hardware_driver_gpiote.html?cp=4_0_0_2_3"&gt;configured&lt;/a&gt; to trigger interrupts on rising edge, falling edge, or both (toggle). Please checkout the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.2.0/nrf_gpiote_example.html?cp=4_0_0_4_6_13"&gt;GPIOTE example&lt;/a&gt; in the SDK.&lt;/p&gt;
&lt;p&gt;Note that you most likely will have to use one extra pin for the GPIOTE, and physically connect this to the PWM signal. I don&amp;#39;t think it is possible to configure GPIOTE to trigger interrupts on a pin configured as output.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>