<?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>nrf52832 pwm</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/45760/nrf52832-pwm</link><description>I want two pwm channel output 1MHZ frequency, the phase difference between two PWM channels is 180 degrees。when i set two pwm frequency to 500KHZ, use the configure below, the pwm is right. nrf_drv_pwm_config_t const config0 = { .output_pins = { EMS_BRIDGE_1_PIN</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 04 Apr 2019 09:49:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/45760/nrf52832-pwm" /><item><title>RE: nrf52832 pwm</title><link>https://devzone.nordicsemi.com/thread/180245?ContentTypeID=1</link><pubDate>Thu, 04 Apr 2019 09:49:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c07f5b6e-a104-46c0-b7f2-3415a7d99dec</guid><dc:creator>lkfanyao</dc:creator><description>&lt;p&gt;Hi Dmitry, &lt;span&gt;thanks for your reply! I have&amp;nbsp;solved this problem by myself!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The correct configure code as follows:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;nrf_drv_pwm_config_t const config2 =&lt;br /&gt; {&lt;br /&gt; .output_pins =&lt;br /&gt; {&lt;br /&gt; EMS_BRIDGE_1_PIN, // channel 0&lt;br /&gt; EMS_BRIDGE_2_PIN, // channel 1&lt;br /&gt; NRF_DRV_PWM_PIN_NOT_USED, // channel 2&lt;br /&gt; NRF_DRV_PWM_PIN_NOT_USED // channel 3&lt;br /&gt; },&lt;br /&gt; .irq_priority = APP_IRQ_PRIORITY_LOWEST,&lt;br /&gt; .base_clock = NRF_PWM_CLK_16MHz,&lt;br /&gt; .count_mode = NRF_PWM_MODE_UP_AND_DOWN,&lt;br /&gt; .top_value = 8,&lt;br /&gt; .load_mode = NRF_PWM_LOAD_INDIVIDUAL,&lt;br /&gt; .step_mode = NRF_PWM_STEP_AUTO&lt;br /&gt; };&lt;br /&gt; &lt;br /&gt; APP_ERROR_CHECK(nrf_drv_pwm_init(&amp;amp;m_pwm2, &amp;amp;config2, NULL));&lt;/p&gt;
&lt;p&gt;// This array cannot be allocated on stack (hence &amp;quot;static&amp;quot;) and it must&lt;br /&gt; // be in RAM (hence no &amp;quot;const&amp;quot;, though its content is not changed).&lt;br /&gt; static nrf_pwm_values_individual_t seq_values[] =&lt;br /&gt; {&lt;br /&gt; 0x8002, 0x6&lt;br /&gt; }; &lt;br /&gt; &lt;br /&gt; nrf_pwm_sequence_t const seq =&lt;br /&gt; {&lt;br /&gt; .values.p_individual = seq_values,&lt;br /&gt; .length = NRF_PWM_VALUES_LENGTH(seq_values),&lt;br /&gt; .repeats = 0,&lt;br /&gt; .end_delay = 0&lt;br /&gt; }; &lt;br /&gt; &lt;br /&gt; (void)nrf_drv_pwm_simple_playback(&amp;amp;m_pwm2, &amp;amp;seq, 1, NRF_DRV_PWM_FLAG_LOOP);&lt;/p&gt;
&lt;p&gt;The correct pwm wave as follow chart:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/F0002TEK.JPG" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 pwm</title><link>https://devzone.nordicsemi.com/thread/180237?ContentTypeID=1</link><pubDate>Thu, 04 Apr 2019 09:33:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d6110bb-0c53-4f7d-8043-12e6b1d4c393</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;Try to set up four samples for each sequence, I had issues with short sequences, &lt;span&gt;length=&lt;/span&gt;4 is ok.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>