This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

pwm doesn't change

Hi there,I am using the PWM library in github github.com/.../nrf51-pwm-library. After I do this in my project and I check the pin output with Oscilloscope but didn't see the PWM change.

int main(void)
{
nrf_pwm_config_t pwm_config = PWM_DEFAULT_CONFIG;
    
    pwm_config.mode             = PWM_MODE_LED_255;
    pwm_config.num_channels     = 1;
    pwm_config.gpio_num[0]      = 11;
    
    // Initialize the PWM library
    nrf_pwm_init(&pwm_config);

        while(true)
    {
        nrf_pwm_set_value(0, 0xFF);
        nrf_delay_ms(1000);
        nrf_pwm_set_value(0, 0x50);
        nrf_delay_ms(1000);
        nrf_pwm_set_value(0, 0x00);
        nrf_delay_ms(1000);
    }

}

I am using the the 8.1 SDK and I changed the function "nrf_gpiote_unconfig" to "nrf_gpiote_task_disable" ,"nrf_gpiote_task_config" to "nrf_gpiote_task_configure" .And I also try the examples in the PWM Library and they didn't work too.

  • Hi

    The PWM library on github is deprecated. It never proved itself to be completely stable. We recommend to use the PWM drivers and examples in the nRF51 SDK 10.0.0 or higher. In nRF51 SDK 10.0.0, users found the PWM to be stable. Check also my answer on this thread.