<?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>Using 2 PWM instances</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73949/using-2-pwm-instances</link><description>Hello, 
 I want to control 2 PWM with different frequencies and hence I am using two separate instances. I want to use only the hardware and not the PWM library. Initializing and everything works fine but when I call the PWM in main loop, the second PWM</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 29 Apr 2021 08:54:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73949/using-2-pwm-instances" /><item><title>RE: Using 2 PWM instances</title><link>https://devzone.nordicsemi.com/thread/307399?ContentTypeID=1</link><pubDate>Thu, 29 Apr 2021 08:54:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48b6e52e-411f-42df-907d-c7d7e3df3b69</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Could you upload the project so I can try to run it here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using 2 PWM instances</title><link>https://devzone.nordicsemi.com/thread/304814?ContentTypeID=1</link><pubDate>Wed, 14 Apr 2021 12:27:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02160e32-fb43-4fbe-9183-05ec2b75dbc9</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The code looks to be correct, except I&amp;#39;m not sure what will happen when you call pwm1() and pwm2() this frequently (looks to me like they will end up being called repeatedly before the play sequence is even complete).&lt;/p&gt;
&lt;p&gt;As a test, could you try to add a &amp;#39;busy wait&amp;#39; between the calls to see if that helps?&lt;/p&gt;
&lt;p&gt;e.g.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;#include &amp;quot;nrf_delay.h&amp;quot;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;int main(void)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;// Initialise...&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;&amp;nbsp; for (;;)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt; idle_state_handle();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;pwm1();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;pwm2();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-family:inherit;"&gt;nrf_delay_ms(10);&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>