<?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>how to make PWM pulse in both channels</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10760/how-to-make-pwm-pulse-in-both-channels</link><description>Hi 
 i wrote the program which is making pulse one time on channel 0 and then followed by channel 1 and then again channel 0 and then 1 going on , my aim is to create pulses on both channel at the same time i tested by conencting buzzer on pin 6 and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 11 Dec 2015 09:52:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10760/how-to-make-pwm-pulse-in-both-channels" /><item><title>RE: how to make PWM pulse in both channels</title><link>https://devzone.nordicsemi.com/thread/40207?ContentTypeID=1</link><pubDate>Fri, 11 Dec 2015 09:52:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b510471f-a262-4658-89ea-6ca9e1d5442f</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;It will not be totally synchronous. The first pwm channel will be updated with the duty set function, then the code will wait for the update to take effect, either with waiting for pwm ready callback or wait for the duty set function to not return NRF_ERROR_BUSY. Then the other channel may be updated. Because of this, there will be an interval of 1 or 2 periods where the PWM channels have different duty cycle.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to make PWM pulse in both channels</title><link>https://devzone.nordicsemi.com/thread/40206?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2015 16:38:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23b769ba-5392-49f8-808d-c109b0b840eb</guid><dc:creator>karan</dc:creator><description>&lt;p&gt;i am using this example from the SDK but this making pulses synchroncially in both pins  for infinite time  by adding this line&lt;/p&gt;
&lt;p&gt;pwm1_cfg.pin_polarity[0] = APP_PWM_POLARITY_ACTIVE_HIGH;&lt;/p&gt;
&lt;p&gt;then can you tell me how this working ?and also  can you tell me how can i make condition for just  five pulses (example just five times on and off uniformally) what condition do i have to set&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to make PWM pulse in both channels</title><link>https://devzone.nordicsemi.com/thread/40205?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2015 16:35:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f66ab6d5-a3f9-4db6-bd52-cb903afa95a7</guid><dc:creator>karan</dc:creator><description>&lt;p&gt;/* 2-channel PWM, 200Hz, output on DK LED pins. */&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;app_pwm_config_t pwm1_cfg = APP_PWM_DEFAULT_CONFIG_2CH(5000L, 6, 7);

/* Switch the polarity of the second channel. */
pwm1_cfg.pin_polarity[1] = APP_PWM_POLARITY_ACTIVE_HIGH;
pwm1_cfg.pin_polarity[0] = APP_PWM_POLARITY_ACTIVE_HIGH; 
/* Initialize and enable PWM. */
err_code = app_pwm_init(&amp;amp;PWM1,&amp;amp;pwm1_cfg,pwm_ready_callback);
APP_ERROR_CHECK(err_code);
app_pwm_enable(&amp;amp;PWM1);

uint32_t value;
while(true)
{
    for (uint8_t i = 0; i &amp;lt; 40; ++i)
    {
        value = (i &amp;lt; 20) ? (i * 5) : (100 - (i - 20) * 5);
        
        ready_flag = false;
        /* Set the duty cycle - keep trying until PWM is ready... */
        while (app_pwm_channel_duty_set(&amp;amp;PWM1, 0, value) == NRF_ERROR_BUSY);
        
        /* ... or wait for callback. */
        while(!ready_flag);
        APP_ERROR_CHECK(app_pwm_channel_duty_set(&amp;amp;PWM1, 1, value));
        nrf_delay_ms(25);
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to make PWM pulse in both channels</title><link>https://devzone.nordicsemi.com/thread/40204?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2015 16:10:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f04169ec-0919-4874-a498-22acc60dc301</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;The pulses will not be totally synchronous if you use the driver. The driver can only set one channel at the time. You could use app_pwm_disable, but also here the output is set sequentially, so you will have an interval in time where one pin is high and the other is low. bottom line: You cannot do this with the pwm driver.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>