<?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>Issue with PPI on PWM (nrf52)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79219/issue-with-ppi-on-pwm-nrf52</link><description>Hello, 
 I&amp;#39;m trying to use PPI over PWM to, at the end of one single PWM period, disable the PWM and switch one GPIO (later, I&amp;#39;ll use it for more complex task, but I start with this). 
 I wrote this (partial) code below (base on SDK &amp;amp; some example I found</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 06 Sep 2021 09:20:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79219/issue-with-ppi-on-pwm-nrf52" /><item><title>RE: Issue with PPI on PWM (nrf52)</title><link>https://devzone.nordicsemi.com/thread/328132?ContentTypeID=1</link><pubDate>Mon, 06 Sep 2021 09:20:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9e34827-83c5-4fa5-9426-049ac00cab6c</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Julien&lt;/p&gt;
&lt;p&gt;What if you put RED, LEFT_RED, GREEN and RIGHT_GREEN on one PWM controller, and BLUE and REAR_BLUE on the second?&lt;/p&gt;
&lt;p&gt;Would that fix the issue of starting the PWM&amp;#39;s at the same time?&lt;/p&gt;
&lt;p&gt;It is possible to do some PPI trickery in order to start the two PWM controllers at exactly the same time, but since you have to bypass the driver to do it it is not the cleanest solution.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you experience glitches, would you be able to measure the lines with a scope or logic analyzer in order to see what they look like?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue with PPI on PWM (nrf52)</title><link>https://devzone.nordicsemi.com/thread/328050?ContentTypeID=1</link><pubDate>Fri, 03 Sep 2021 21:41:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62f9f0e5-dcec-460e-a4a5-8e5002bfcc67</guid><dc:creator>Julien Cosmo</dc:creator><description>&lt;p&gt;Dear&amp;nbsp;&lt;span&gt;Torbj&amp;oslash;rn&amp;nbsp;,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I just found an other solution without PPI :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I keep the PWM on [RED, GREEN, BLUE] pins, with a sequence or 3 values on each channels corresponding of the RGB of the 3 leds.&lt;/p&gt;
&lt;p&gt;And I apply an other PWM on pins [LEFT_LED, RIGHT_LED, REAR_LED] with also 3 values on each channels so that only one led is active at each pwm period.&lt;/p&gt;
&lt;p&gt;I still don&amp;#39;t know how to start precisely the 2 PWMs at the same time...&lt;/p&gt;
&lt;p&gt;And It&amp;#39;s not perfect, I&amp;#39;ll need to check why (I still have visible glitches)&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Julien&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue with PPI on PWM (nrf52)</title><link>https://devzone.nordicsemi.com/thread/327920?ContentTypeID=1</link><pubDate>Fri, 03 Sep 2021 08:50:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:503a7ae7-c145-48b8-bdd2-a836151ae25c</guid><dc:creator>Julien Cosmo</dc:creator><description>&lt;p&gt;Thank you&amp;nbsp;&lt;span&gt;Torbj&amp;oslash;rn for your answer.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In fact this is just the beginning&amp;nbsp;of what I need (and I&amp;#39;m very sad I can not make it work).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Anyway your suggestion may be useful, but I think I&amp;#39;ll still need PPI even if I don&amp;#39;t use it for the clearing of the pin.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Let me explain my full purpose here :&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I want to control 3 RGB leds using 3 GPIO to select the RGB led, and 3 GPIO in PWM mode for the 3 colors RGB. I need time sharing (1/3 of the time for each leds) to set whatever color on each leds.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/leds.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I first tried an obvious interrupt driven solution, where at each PWM period I switched leds GPIO &amp;amp; PWM values. But this does not&amp;nbsp; work due to the softdevice BLE scan as it uses higher priority interrupt and the time sharing is lost (there are many glitches&amp;nbsp;on leds)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So I&amp;#39;m now focusing on using only PPI to do the time sharing, my main idea is to use 3 PWM modules to control alternatively&amp;nbsp;each leds during one period only, and after each period turn off itslef and activate the next PWM module - and also set/clear appropriate led GPIO. I still don&amp;#39;t know if it&amp;#39;s possible to do that, and I was first trying to turn off one PWM after a PWM period, and also clear a GPIO, using PPI.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m not sure I&amp;#39;m clear enough ?&lt;/span&gt;&lt;/p&gt;
&lt;pre class="tw-data-text tw-text-large XcVN5d tw-ta" id="tw-target-text"&gt;&lt;span class="Y2IQFc" lang="en"&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue with PPI on PWM (nrf52)</title><link>https://devzone.nordicsemi.com/thread/327900?ContentTypeID=1</link><pubDate>Fri, 03 Sep 2021 07:41:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:567cf0b5-98b9-4526-b346-d66610434b03</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Julien&lt;/p&gt;
&lt;p&gt;Do you happen to have a diagram showing what you are trying to achieve with the different pins?&lt;/p&gt;
&lt;p&gt;Setting and clearing a pin is the same as setting duty cycle to 100 or 0% through the PWM module, so couldn&amp;#39;t you just assign REAR_LED to the 4th PWM pin and set the buffer value to 0 or PWM_PERIOD (100%)?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>