<?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>PWM cannot set to 125khz frequency</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/40873/pwm-cannot-set-to-125khz-frequency</link><description>Hi, 
 I am using the nrf-52840 DK. 
 I modified the pwm_library to output 125khz frequency. 
 app_pwm_config_t pwm1_cfg = APP_PWM_DEFAULT_CONFIG_2CH(125000L, NRF_GPIO_PIN_MAP(1,0) , NRF_GPIO_PIN_MAP(1,3)); 
 I check the oscilloscope, the IC cannot generate</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 27 Nov 2018 01:39:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/40873/pwm-cannot-set-to-125khz-frequency" /><item><title>RE: PWM cannot set to 125khz frequency</title><link>https://devzone.nordicsemi.com/thread/159130?ContentTypeID=1</link><pubDate>Tue, 27 Nov 2018 01:39:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b562e896-b6c7-4091-90ac-984246bb0b17</guid><dc:creator>konsang</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;/p&gt;
&lt;p&gt;Got it and Thanks.&lt;/p&gt;
&lt;p&gt;Br,&lt;/p&gt;
&lt;p&gt;KonSang&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM cannot set to 125khz frequency</title><link>https://devzone.nordicsemi.com/thread/159047?ContentTypeID=1</link><pubDate>Mon, 26 Nov 2018 14:07:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a65a41b-d7fa-4c63-89c4-819da7c73c85</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;APP_PWM_INSTANCE(PWM1,1);                   // Create the instance &amp;quot;PWM1&amp;quot; using TIMER1.

static volatile bool ready_flag;            // A flag indicating PWM status.

void pwm_ready_callback(uint32_t pwm_id)    // PWM callback function
{
    ready_flag = true;
}

int main(void)
{
    ret_code_t err_code;

    /* 2-channel PWM, 125kHz, output on DK LED pins. */
    app_pwm_config_t pwm1_cfg = APP_PWM_DEFAULT_CONFIG_2CH(8L, BSP_LED_0, BSP_LED_1);

    /* Switch the polarity of the second channel. */
    pwm1_cfg.pin_polarity[1] = 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);
    
    app_pwm_channel_duty_set(&amp;amp;PWM1, 0, 50);
    app_pwm_channel_duty_set(&amp;amp;PWM1, 1, 50);

    while (true)
    {        
    }

}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>